ITPub博客

首页 > IT基础架构 > 网络安全 > 两机之间不用密码传输文件(转)

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

原创 网络安全 作者:post0 时间:2007-08-11 16:36:40 0 删除 编辑
两机之间不用密码传输文件(转)[@more@]

首先假定有两台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 promp

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8225414/viewspace-946268/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    2018
  • 访问量
    8226436