ssh免密码登陆服务器
2015-01-07 16:43
211 查看
这个是在cygwin中操作的,其实都是通用的。
执行ssh-keygen命令,生成公钥:
$ ssh-keygen.exe -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/shizh1/.ssh/id_rsa):
Created directory '/home/shizh1/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/shizh1/.ssh/id_rsa.
Your public key has been saved in /home/shizh1/.ssh/id_rsa.pub.
The key fingerprint is:
a4:37:66:a7:7e:75:60:ca:8e:e9:49:3c:74:c2:e7:41 shizh1@SHIZH1-PC0011NN
The key's randomart image is:
+---[RSA 2048]----+
| |
| |
| . E |
| + . o |
| . S.=o . |
| * Oo.. . |
| =+.. . |
| oooo |
| .+. |
+-----------------+
把公钥复制到服务器上:
$ ssh-copy-id shizh1@10.100.124.230
The authenticity of host '10.100.124.230 (10.100.124.230)' can't be established.
ECDSA key fingerprint is 22:64:04:a0:e6:0b:f6:0c:dd:80:3a:8c:2c:35:b8:50.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
shizh1@10.100.124.230's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'shizh1@10.100.124.230'"
and check to make sure that only the key(s) you wanted were added.
登录到服务器上:
$ ssh shizh1@10.100.124.230
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.17.1 x86_64)
* Documentation: https://help.ubuntu.com/ You have packages from the Hardware Enablement Stack (HWE) installed that
are going out of support on 2014-08-07.
There is a graphics stack installed on this system. An upgrade to a
supported (or longer supported) configuration will become available
on 2014-07-16 and can be invoked by running 'update-manager' in the
Dash.
*** System restart required ***
Last login: Sun Jan 4 12:33:44 2015 from 10.110.54.143
OK了!
执行ssh-keygen命令,生成公钥:
$ ssh-keygen.exe -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/shizh1/.ssh/id_rsa):
Created directory '/home/shizh1/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/shizh1/.ssh/id_rsa.
Your public key has been saved in /home/shizh1/.ssh/id_rsa.pub.
The key fingerprint is:
a4:37:66:a7:7e:75:60:ca:8e:e9:49:3c:74:c2:e7:41 shizh1@SHIZH1-PC0011NN
The key's randomart image is:
+---[RSA 2048]----+
| |
| |
| . E |
| + . o |
| . S.=o . |
| * Oo.. . |
| =+.. . |
| oooo |
| .+. |
+-----------------+
把公钥复制到服务器上:
$ ssh-copy-id shizh1@10.100.124.230
The authenticity of host '10.100.124.230 (10.100.124.230)' can't be established.
ECDSA key fingerprint is 22:64:04:a0:e6:0b:f6:0c:dd:80:3a:8c:2c:35:b8:50.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
shizh1@10.100.124.230's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'shizh1@10.100.124.230'"
and check to make sure that only the key(s) you wanted were added.
登录到服务器上:
$ ssh shizh1@10.100.124.230
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.17.1 x86_64)
* Documentation: https://help.ubuntu.com/ You have packages from the Hardware Enablement Stack (HWE) installed that
are going out of support on 2014-08-07.
There is a graphics stack installed on this system. An upgrade to a
supported (or longer supported) configuration will become available
on 2014-07-16 and can be invoked by running 'update-manager' in the
Dash.
*** System restart required ***
Last login: Sun Jan 4 12:33:44 2015 from 10.110.54.143
OK了!
相关文章推荐
- 如何不用密码 ssh登陆服务器
- ssh免密码登陆服务器
- 菜鸟Linux系列:[4]SSH免密码登陆远程服务器
- Linux上实现ssh免密码登陆远程服务器 推荐
- SSH远程登陆服务器要很久才出现输入密码界面怎么办
- ssh无密码登陆服务器
- SSH免密码登陆远程服务器配置
- sshpass实现ssh自动输入密码登陆服务器
- SSH免密码登陆远程服务器
- 服务器ssh_key授权,并禁止密码登陆
- ssh免密码登陆 - 服务器建立信任关系
- ssh 免密码登陆ubuntu腾讯云服务器
- 跨过跳板机,SSH免密码登陆服务器
- 怎样用一台本地主机ssh免密码登陆多台远程服务器
- 使用SSH证书(不要密码)登陆远程服务器
- linux下无密码ssh登陆服务器
- Mac客户端CentOS服务器 SSH免密码登陆
- ssh免密码登陆远程服务器
- SSH免密码登陆远程服务器
- Hadoop ssh实现远程服务器免密码登陆