ssh 相关的一点小技巧
Posted 11 months, 1 week ago at 11:32 am. 0 comments
ad 468x60
vi /etc/ssh/sshd_config 如下:
Port 44444
Protocol 2
PermitRootLogin without-password #root用户必须有key才能登陆
UseDNS no
PasswordAuthentication no # 强制只有key才能登陆
# 以上仅针对登陆机
# 如何来建立自己名字的key呢?
ssh-keygen -C bixuan -t dsa
如果是从secureCRT生成的,那必须转换一下:
ssh-keygen -i -f Identity.pub >> authorized_keys
如个openssh的版本低于2.9
那么请用:
ssh-keygen -X -f Identity.pub >> authorized_keys
即可
附注:(建议ListenAddress 0.0.0.0改成只监听内网ip,省得开销iptables。laurence注)
# cat /etc/ssh/sshd_config
UseDNS no
Port 44444
Protocol 2
PermitRootLogin without-password
#PermitRootLogin yes|No
PasswordAuthentication no
Subsystem sftp /usr/libexec/openssh/sftp-server
Popularity: 9% [?]
Tags: cat, vi
ad 468x60
Related posts
No Replies
Feel free to leave a reply using the form below!