牵着老婆满街逛

严以律己,宽以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

让FreeBSD的root用户能够SSH登陆

如果刚装好FreeBSD,默认是不允许root用户登录SSH的,如果登陆结果就会如下:
用PuTTY登陆时,总提示:
login 
as: root
Using keyboard
-interactive authentication.
Password:
Access denied


这个时候需要编辑其配置文件,输入以下命令进行修改:
ee /etc/ssh/sshd_config
然后进行修改.


找到
#PasswordAuthentication no
修改为:
PasswordAuthentication yes
这段的意思是,让SSH使用密码验证登陆.

找到
#PermitRootLogin no
修改为
PermitRootLogin yes
这段的意思是,让SSH准许root用户登录.一般来说,为了安全起见,这一段还是不要允许的好.不过安全要求不高,可以这样做.

找到
#PermitEmptyPasswords no
修改为
PermitEmptyPasswords no
这段的意思是,使得允许空密码成为不可用,换句话说就是,不允许空密码登陆.

检查是否在/etc/inetd.conf 中打开了,请把它注释掉:
ssh     stream  tcp     nowait  root    /usr/sbin/sshd          sshd -i -4
改成
#ssh     stream  tcp     nowait  root    /usr/sbin/sshd          sshd -i -4
保存、重启
/etc/inetd restart


这样就root用户就可以用SSH客户端远程登陆FreeBSD了.

需要注意的是,在/etc/ssh下面有两个配置文件:/etc/ssh/sshd_config和/etc/ssh/ssh_config,我们需要修改的是/etc/ssh/sshd_config,我最开始就弄错了--!修改到了/etc/ssh/ssh_config去了,结果咋都不对,寒.

posted on 2010-06-24 11:05 杨粼波 阅读(1778) 评论(0)  编辑 收藏 引用 所属分类: FreeBSD


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理