您的位置:首页 > 文档 > ssh >
 文章分类 

两机之间不用密码传输文件


创建:2005-10-27 22:57:41
作者:Unlinux
来自: http://www.Unlinux.com

首先假定有两台linux机器,linux1和linux2。 你想从linux1向linux2拷贝机器时无需输入密码,或者是在ctontab中这样做。
1. 安装SSH
2. 创建两个用户,user1在linux1上,user2吱在linux2上。
3. On linux2, login as user2. do
ssh-keygen -P "" -trsa1 -f ~/.ssh/identity
4. Copy key file to linux1
scp /home/user2/.ssh/identity.pub user1@linux1:/home/user1/.ssh/authorized_keys
5. Change file permission
chmod 600 /home/user2/.ssh/authorized_keys
6. change ssh config file: /etc/ssh/ssh_config
Ad
Host *
ForwardX11 yes
IdentityFile ~/.ssh/identity
Protocol 1
7. Restart sshd
8. login to linux1 as user1.
9.Change file permission
chmod 600 /home/user1/.ssh/identity
10. Restart sshd
Now, you can ssh or secure copy filles by using user1 from linux1 to linux2 without prompt

转载自:http://www.unlinux.com/doc/ssh/20051027/5361.html

评论】 【加入收藏夹】 【 】 【打印】 【关闭
 *  请尊重我们的劳动,转载请注明出自UnLinux.Com及作者名 * 

※ 相关链接
无相关信息
Copyright © 2005 UnLinux.Com All Rights Reserved