scp使用RSA秘钥传输数据

1.生成密钥对

ssh-keygen


id_rsa为私钥文件(保存在client),id_rsa.pub为公钥(用于追加到server的用户目录/.ssh/authorized_keys文件中)


2.下载数据


scp  -i  ~/.ssh/id_rsa  -r root@remote_ip:/data/www/develop/develop_activity_task  /data/www/activity_task_bak


3.上传数据

scp -i ~/.ssh/id_rsa  -r /data/www/poker/pokerServer root@remote_ip:/data/www/


4.ssh登录


ssh使用RSA密钥对登录也是同理,service名称为sshd,配置文件为/etc/ssh/sshd_config


猜你喜欢

转载自blog.csdn.net/xxq929604980/article/details/78924974