Chinaunix

标题: ssh和scp不需要密码进行登陆和远程拷贝文件 [打印本页]

作者: zhrenxi    时间: 2009-04-07 14:36
标题: ssh和scp不需要密码进行登陆和远程拷贝文件
、创建公私钥
[root@cqenus2 enusdbbk]# ssh-keygen -d
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
/root/.ssh/id_dsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
a8:52:5b:30:0b:42:b0:cf:af:99:7a:52:01:88:28:87
[email=root@cqenus2]root@cqenus2[/email]
cp /root/.ssh/id_dsa.pub cqenus3:/root/.ssh/authorized_keys
2、ssh [-p 2266] host
   scp [-P 2266] a.sql cqenus3:/opt/enusdbbk
ssh和scp远程拷贝也就不需要密码了

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11971/showart_1892209.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2