Linux主机建立信任关系
2012-09-13 23:38
369 查看
原理略过不表,shell脚本见下。
#!/bin/bash
# usage: makessh.sh hostname
to_host=$1
rsa_pub="~/.ssh/id_rsa.pub"
if [ ! -f $rsa_pub ];then
ssh-keygen -t rsa
fi
ssh "$to_host" 'test -d .ssh || mkdir -m 0700 .ssh ; cat >>.ssh/authorized_keys && chmod 0600 .ssh/*' < ~/.ssh/id_rsa.pub
#!/bin/bash
# usage: makessh.sh hostname
to_host=$1
rsa_pub="~/.ssh/id_rsa.pub"
if [ ! -f $rsa_pub ];then
ssh-keygen -t rsa
fi
ssh "$to_host" 'test -d .ssh || mkdir -m 0700 .ssh ; cat >>.ssh/authorized_keys && chmod 0600 .ssh/*' < ~/.ssh/id_rsa.pub
相关文章推荐
- 两条命令在Linux主机之间建立信任关系
- 两台Linux主机如何建立ssh信任关系?
- Linux主机间建立信任关系,无ssh密码登陆主机的问题
- linux主机之间建立ssh信任关系
- Linux主机间建立信任关系
- Linux系统主机之间建立信任关系
- linux主机之间建立信任关系
- Linux主机间建立信任关系
- Linux主机间建立信任关系
- linux命令--建立主机信任关系
- 两台Linux主机如何建立ssh信任关系
- linux命令--建立主机信任关系
- linux debian系统的两台主机之间建立安全信任关系及scp传输文件的免密操作
- 两台Linux系统主机建立ssh信任关系的过程
- Linux主机见建立信任关系
- 两台linux机器之间建立信任关系
- linux建立ssh信任关系
- 两台linux服务器之间建立ssh信任关系
- linux建立信任关系
- zz linux建立ssh信任关系