我想隧道一个mysql数据库。所以我想我使用一个没有密码的私钥来让它重启友好。问题是,openssh 仍然要求我输入密码,如果我把它留空,它就会拒绝连接。有没有办法禁用密码短语问题并允许没有密码的连接?
/usr/bin/autossh -M 20009 -N -L 3307:127.0.0.1:3306 -p 22 -i /home/tunnel-vserver_main-mysql/keys/tunnel_mysql ssh-tunnel@IP
tunnel_mysql 看起来像这样,有错吗?:
I deleted a bit and it is still a trash key.
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20130902
Public-Lines: 4
AAAAB3NzaC1yc2EAAAABJQAAAIBSeG8XkgFsq3TK8MQm9+8Uk+waP0k/xfySbE2Q
ktBsaG/XQd6MskhPjPr*****j5p0VcfWfkpopVB/s
iA1WNJl4Tw/ELxRe6s8XJaz+G2L6K4nCZK/rTdAus4MuwAwWFUmteU7P/Okb6jQ3
SNWPVQ==
Private-Lines: 8
AAAAgDwuXuevu9mtjJQXemGgKwEtrEqBNXO5/X+bI9gzyIZ1uWW6cff3uDoM7mZQ
kznCzjZmvK2l7DhVlHeO2hUKXdldzAIIZmILiIuQb819Hupb4jxApk7zwQREYqW2
a8+pz5LdtGHt****AGaEB+cbCULCeHrzJPP9BY
sWigPwjI47vbAAAAQQCFLH7cXVEiNzmHZyX6XE2Gu++t4LvIVtegBb8koKOzOM9O
6EGDP7I+V4nQI+L6ykKIL6S4pNJp9UaHCKGLwOCPAAAAQHE50FWzp1uB9KJ4qYJe
NS4pLSC88KOYJyT6W66Z1nCLeAL9VG2v1vOZoDsuXDUroVj4uEjq0wmdmif2fOMH
HoM=
Private-MAC: ***
您可以为此使用普通 ssh:
只需确保密钥在该帐户的 .ssh/id_rsa 中,并且它也在远程端的 .ssh/authorized_users 文件中。
也许 Stunnel 适合这里?
https://www.stunnel.org/index.html