快速建立ssh相互认证

上一篇 / 下一篇  2007-08-13 00:00:00 / 个人分类:linux

建立oracle的rac经常要建立ssh相互认证,每次都是使用copy 和 paste来建立,很容易错误,自己写了一个简单的脚本,很容易完成这个工作,如下:

mkdir -p ~/.ssh
chmod 755 ~/.ssh
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
echo -n "wait another host $1 run finish, press twice key continue !!!"
read a
read a
ssh $1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh $1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
chmod 644 ~/.ssh/authorized_keys

# 命名脚本 为可执行

chmod 755 sshx

./sshx remote_ip

就可以了!



TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-11  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 7740
  • 日志数: 645
  • 建立时间: 2008-01-03
  • 更新时间: 2008-09-23

RSS订阅

Open Toolbar