cenots suse 之间无密码登录之openssh与ssh2 key的转换

install ssh2
wget http://ftp.nluug.nl/security/ssh/ssh-3.2.9.1.tar.gz
./configure --prefix=/usr/local/ssh2
[root@localhost ssh-3.2.9.1]# /usr/local/ssh2/bin/ssh-keygen2 -P /etc/ssh2/hostkey
Generating 2048-bit dsa key pair
8 o.oOo.oOo.oO
Key generated.
2048-bit dsa, root@localhost.localdomain, Fri Feb 21 2014 10:01:07 +0800
Private key saved to /etc/ssh2/hostkey
Public key saved to /etc/ssh2/hostkey.pub
#run
nohup /usr/local/ssh2/sbin/sshd2 &
http://wenku.baidu.com/view/bb2f32f7ba0d4a7302763ac5.html
SSH2 的 key format 與 OpenSSH 不同,這在兩者之間要作 public key authentication 時造成了一些麻煩。OpenSSH 提供的 ssh-keygen 可以用 -e 和 -i 兩個選項來轉換兩者的 key format:
# ssh-keygen -e -f openssh-key.pub > ssh2-key.pub
# ssh-keygen -i -f ssh2-key.pub > openssh-key.pub
http://leeon.me/a/openssh-ssh2-notes
**************************************
centos
suse
******************************************************
1. (SSH2) 客户端登陆OpenSSH server
openssh to login ssh2
www@VM:~> ssh-keygen2
Generating 2048-bit dsa key pair
3 o.ooOo.oOo.o
Key generated.
-bash-4$ mkdir .ssh
-bash-4$ cp id_dsa_2048_a.pub .ssh
-bash-4$ cd .ssh
## ssh2 pub key 转成 openssh pub key
-bash-4.1$ ssh-keygen -i -f id_dsa_2048_a.pub > imported-ssh2-key.pub
-bash-4.1$ cat imported-ssh2-key.pub >> authorized_keys
-bash-4.1$ ls
authorized_keys id_dsa_2048_a.pub imported-ssh2-key.pub
-bash-4.1$ cd ..
-bash-4.1$ chmod -R 700 .ssh/
-bash-4.1$ chmod 600 .ssh/authorized_keys
-bash-4.1$ chown -R root.root .ssh
在 suse 登录 centos 输入几个yes 后就成功了
**************************************************
2. (OpenSSH) 客户端登陆SSH2 server (SSH2 Key)
(1).openssh pub key — 转–>ssh2 pub key
#openssh 机器
-bash-4.1$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/data/www/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
ssh-keygen -e -f id_rsa.pub > id_rsa_2.pub
##下面到 ssh2机器
然后将公钥id_rsa_2.pub上传到ssh2 上去
cd .ssh2
#在里面新增一行 Key id_rsa_2.pub #保存修改
echo 'Key id_rsa_2.pub' >>authorization
这要就可以从 openssh 登录 ssh2 那台了
(2).ssh2 pri key ->openssh pri key
ssh2 192.168.1.97
openssh 192.168.1.96
#on ssh2
/usr/local/ssh2/bin/ssh-keygen2
cd /root/.ssh2/
cp -p id_dsa_2048_a newkey
scp newkey 192.168.1.97:~

[root@localhost .ssh2]# vi authorization
key id_dsa_2048_a.pub

on openssh
[root@localhost ~]# ssh-keygen -i -f newkey >openkey
[root@localhost ~]# chmod 600 openkey
[root@localhost ~]# ssh -i openkey 192.168.1.96
*********************************************************************************************************************
http://www.blogjava.net/bacoo/archive/2011/08/17/356703.html
http://blog.urdada.net/2008/01/03/70/
Suse SSH2 实现root无验证登陆
http://www.tuicool.com/articles/22yqya