ssh-copy-id命令 – 复制公钥到远程主机

ssh-copy-id命令可以把本地主机的公钥复制到远程主机的authorized_keys文件上,ssh-copy-id命令也会给远程主机的用户主目录(home)和~/.ssh, 和~/.ssh/authorized_keys设置合适的权限。

语法格式:ssh-copy-id [参数]

常用参数:

-i指定公钥文件

参考实例

拷贝本机公钥到远程主机上面:

[root@linuxyeah ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.3.22


Comments are closed.