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

ssh生成公钥 #9

Open
paddingme opened this Issue Dec 4, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@paddingme
Owner

paddingme commented Dec 4, 2015

1 本地生成公钥和私钥

这里命名为 test( 生成之后公钥为 test.pub 私钥 test 位于 ~/.ssh 下)

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/paddingme/.ssh/id_rsa): test
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in test.
Your public key has been saved in test.pub.
The key fingerprint is:

2 发送公钥到远程服务器上

$ ssh-copy-id remoteUser@remoteHost

3 测试是否可以免密登录

$ssh remoteUser@remoteHost

不行的话

登录远程服务器
vim /etc/ssh/sshd_config 找到 以下三行去行首#号

  RSAAuthentication yes
  PubkeyAuthentication yes
  AuthorizedKeysFile .ssh/authorized_keys

保存退出

ok!再测试

@paddingme paddingme closed this Sep 4, 2017

@paddingme paddingme reopened this Sep 4, 2017

@paddingme

This comment has been minimized.

Show comment
Hide comment
@paddingme

paddingme Sep 9, 2017

Owner

测试

Owner

paddingme commented Sep 9, 2017

测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment