ssh免登陆验证

来源:互联网 发布:淘宝拍a发b教程 编辑:程序博客网 时间:2024/05/21 04:02

1.编辑hosts文件,添加ip和主机的映射

vi /etc/hosts


cache01,cache02,cache03都是我自定义的主机名(vi /etc/hostname可编辑)

2.配置ssh
生成本地密钥
ssh-keygen -t rsa

到ssh目录下
cd /root/.ssh/
复制密钥到authorized_keys
cp id_rsa.pub authorized_keys
执行下面的操作,把其他的服务器上也重复执行了,其他几个cache也一样操作
ssh-copy-id -i cache01
ssh-copy-id -i cache02
ssh-copy-id -i cache03

执行完使用

ssh cache01

输入一次密码后面就不需要再次输入了,其他同样

ssh cache02

ssh cache03


至此,ssh免登配置完成

原创粉丝点击