标签 密钥 下的文章

CentOS6.x设置ssh免密码登陆

在本地跳板机上执行ssh-keygen -t rsa -P ''

[root@c160 ~]# ssh-keygen -t rsa -P ''

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa): 

Created directory '/root/.ssh'.

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/id_rsa.pub.

The key fingerprint is:

0a:ff:31:85:fc:80:e0:00:ff:29:53:b6:22:e2:37:66 root@c160

The key's randomart image is:

+--[ RSA 2048]----+

|.                |

| o               |

|  o +            |

|   * + o .       |

|o + * . S .      |

|o. + o . +       |

| . E  o o .      |

|  + .  . o       |

|        .        |

+-----------------+

生成公钥id_rsa.pub和密钥id_rsa,默认路径在/root/.ssh下面,其他用户在/home/username/.ssh下面,分发公钥id_rsa.pub到目标机器上,如:

scp id_rsa.pub root@10.20.1.2:/root/.ssh/authorized_keys
chmod 700 /root/.ssh/ -R 
chmod 600 /root/.ssh/authorized_keys

---阅读剩余部分---

最新

分类

归档

评论

  • 安安: 都是af
  • Liang: 嗯,有点不通顺·
  • 王庭威: “MySQL互为主从...
  • Liang: 贴下编译参数和步骤,...
  • shao3911: 您好,为什么我在编译...
  • aliang: 先看是yum安装还是...
  • aliang: 将原来的nginx安...
  • yen: 3、如果要回滚的话,...
  • yen: 刚好需要升级ngin...
  • 文雨: 一些新的method...

其它