Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth-source.el 不是很会用 #33

Open
alyato opened this issue Jul 6, 2017 · 5 comments
Open

auth-source.el 不是很会用 #33

alyato opened this issue Jul 6, 2017 · 5 comments

Comments

@alyato
Copy link

alyato commented Jul 6, 2017

我想通过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:

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

@lujun9972
Copy link
Owner

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

@lujun9972
Copy link
Owner

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

@alyato
Copy link
Author

alyato commented Jul 8, 2017

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

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

@kaiwk
Copy link

kaiwk commented Oct 23, 2017

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

@LdBeth
Copy link
Contributor

LdBeth commented Oct 30, 2017

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

(setq tramp-default-method "ssh")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants