ssh免密登录
生成钥匙:
[root@localhost .ssh]# ssh-keygen -t rsa # 无-C指定,默认为root,生成位置都是/root/.ssh目录中
[root@localhost .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqzoU0JF5D6H6uwL0m5niMnnIyCDupllDoiVlrITtuY5ZkTMSATaT9yP+VuCEmKwGjnIgHrU4TmGp7RhPFUtTHLhwac58L8rUFd/0vg/NRg0pfpJKFKOCgCJXKWQ5gTZL8cb+1xXvusRbzNIzx+QQdfTEN1UQo3Zbti62RJRT7HqBDMuw+kKpBC+7BJufLZexZ9jTpmhwxQUEtFreOXjT+nQWP18iYbXpowJAZ/FjwyZPKipEqy6A3c2wstA09UEAQryO1vkqVVGBhSz2GZOUSZPj9EZEnOR+ob4dLCxvqPvuSAxg5/Nh/xMmwsQMeZI5jovZbhktyJZDDNMZFSVkh root@localhost.localdomain
[root@localhost .ssh]# ssh-keygen -t rsa -C "uuf"
[root@localhost .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkK8SoT7ja+H3a1TTxdmYAI7wxLgr9CawCrutOsn51tdnoWn+IOCv0EvQmqJ17Z6gwuxGVRPBIag9fkendYAJ+Q/vM0t8485MSC/ilDLzAOk46tsHX67xqqC6XkIfFvkzZ44wwsHnh68sA8x6f1iEI6Eus+gohgGR+ukLqFE1LgldUJOJix1VsJgRxeoBiszs/QtRq5w5Fefvw7TzKxeWWUrqNAqQmiTSuzurjVNMG8F8O5MZ4E0Wa/3zIVku/OiKTmFptJhJHgLOI08EiCFhXMnrgajEWN4YfAzb+axvzqrDx5AZxpgfIC3Nes4bnXCS044qDqNUaONOLG5vWJz2J uuf
拷贝公钥:
ssh-copy-id -i ~/.ssh/id_rsa.pub dss@10.164.194.42 #你需要免密登录的用户跟IP