简体   繁体   English

Emacs-无法使用其他用户名流浪

[英]Emacs - Unable to tramp with a different username

I have the following setup in my ssh's config file: 我在ssh的config文件中有以下设置:

Host my_username.remote
 User my_username
 HostName server.xxx.com
 IdentityFile ~/.ssh/general_id_rsa
 ControlMaster auto
 ControlPath ~/.ssh/%r@%h:%p        

Host different_username.remote
 User different_username
 HostName server.remote.net
 IdentityFile ~/.ssh/general_id_rsa
 ControlMaster auto
 ControlPath ~/.ssh/%r@%h:%p        

The above config works with no problem on the terminal, ie I can do ssh my_username.remote or ssh.different_username.remote and it will login on the remote server with the right credentials correctly. 上面的配置在终端上没有问题,即我可以执行ssh my_username.remotessh.different_username.remote ,它将正确地使用正确的凭据登录到远程服务器上。

However, when I do this in Emacs, I can login with my credentials, ie /ssh:my_username.remote:/ , but not with /ssh:different_username.remote:/ . 但是,当我在Emacs中执行此操作时,可以使用我的凭据登录,即/ssh:my_username.remote:/ ,但不能使用/ssh:different_username.remote:/

I should note that on my local machine I am also my_username . 我应该注意,在我的本地计算机上,我也是my_username So the problem seems to come from using a different username. 因此,问题似乎出在使用其他用户名。

Any thoughts on what's causing this? 关于什么原因的任何想法?

I'm fairly sure Tramp will supply default values when you don't specify parameters, in which case /ssh:different_username.remote would be translated to /ssh:my_username@different_username.remote . 我很确定Tramp将在您不指定参数时提供默认值,在这种情况下,/ /ssh:different_username.remote将转换为/ssh:my_username@different_username.remote

I would think you'd be able to use /ssh:different_username@different_username.remote , even if it's not able to pick up the automatic config. 我认为您可以使用/ssh:different_username@different_username.remote ,即使它无法自动配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM