emacs-document icon indicating copy to clipboard operation
emacs-document copied to clipboard

auth-source.el 不是很会用

Open alyato opened this issue 7 years ago • 5 comments

我想通过tramp链接服务器。 在mac总配置了ssh,emacs-version 25.1 但是在用auth-source,不是很会用。 我的设置是:

(require 'auth-source) (setq auth-sources '((:source "~/.authinfo")))

其中.authinfo , machine myName login IP port ssh password xxxxx

但是不能运行。

c x c f /myName:

回车之后,仍然让我输入密码。 请问,我那个地方设置错误。谢谢。

alyato avatar Jul 06 '17 05:07 alyato

你的.authinfo中制定了port是ssh,那么先得确定你的tramp使用的是ssh协议. 看看你的tramp-default-method和tramp-default-method-alist是怎么配置的吧

lujun9972 avatar Jul 07 '17 14:07 lujun9972

或者你直接指定用ssh来访问远程文件试试,像这样 C-x C-f /ssh:root@otherhost:/etc/motd RET

lujun9972 avatar Jul 07 '17 14:07 lujun9972

C-x C-f /ssh:root@otherhost:/etc/motd RET 上面的可以连接到,但是需要输入IP等,麻烦。

下面是我的配置: trapmp 我还在/etc/ssh/ssh_config 下配置: Host,HostName,User 但是用auth-source中的machine,不会了,也不知道哪里出错

alyato avatar Jul 08 '17 06:07 alyato

machine foobar.com(domain name or IP) port ssh (you can also use other inline method ) login your-account password yout-password

You can use .authinfo.gpg store your email password or ssh password.

Here is the example:

  • for email: machine imap.163.com port 993 login [email protected] password xxxxx machine smtp.163.com port 465 login [email protected] password xxxxx
  • for ssh: machine some_ip port ssh login somebody password xxxxx

kaiwk avatar Oct 23 '17 07:10 kaiwk

Tramp 用 rsync rsh ssh ftp telnet等协议传文件,你没有指定用哪种方法当然会出问题。

(setq tramp-default-method "ssh")

LdBeth avatar Oct 30 '17 08:10 LdBeth