- 用ssh-keygen命令或者PUTTY先在客户端机器上生成公钥,私钥对。也可以在任何机器上生成 公钥,私钥对,但在其它包括服务器上生成的话,需要把私钥复制到客服端,这不是一个好的做法。
- 把公钥(id_rsa.pub)内容复制到服务器的$HOME/.ssh/authorized_keys目录,如果目录不存在则创建一个。
- 检查和设置目录文件权限。
chmod 700 $HOME/.ssh
chmod go-w $HOME $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
chown `whoami` $HOME/.ssh/authorized_keys - 设置PUTTY或者其它SSH客户端使用对应的用户名和私钥登录。如果用SHELL客户端则需要把确保私钥保存在$HOME/.ssh/id_rsa,权限设置为400。
11 responses to “SSH实现无密码登录”
hello world
hello world
lisinopril 5 mg tablet
lisinopril 5 mg tablet
ursodiol 300 mg
ursodiol 300 mg
online azithromycin
online azithromycin
ciprofloxacino dexametasona
ciprofloxacino dexametasona
doxycycline for sinus infection
doxycycline for sinus infection
generic antibiotics online cheap
generic antibiotics online cheap
zyloprim allopurinol 300 mg
zyloprim allopurinol 300 mg
vibramycin ointment
vibramycin ointment
metoprolol brand
metoprolol brand
stendra 200 mg precio
stendra 200 mg precio