首先vi编辑/etc/inetd.conf,去掉ssh前的#,保存退出
编辑/etc/rc.conf
最后加入:sshd_enable=”yes”即可
激活sshd服务:

#/etc/rc.d/sshd start

用下面命令检查服务是否启动,在22端口应该有监听。

#netstat -an ## check port number 22

最后
vi /etc/ssh/sshd_config,
ee /etc/ssh/sshd_config

  ———————————————
  #Protocol 2,1
  修改为:
  Protocol 2
  #ListenAddress 0.0.0.0
  修改为:
  ListenAddress 0.0.0.0
  #PermitRootLogin yes
  修改为
  PermitRootLogin yes
IgnoreRhosts yes
IgnoreUserKnownHosts yes
PrintMotd yes
StrictModes no
RSAAuthentication yes
PermitRootLogin yes #允许root登录
PermitEmptyPasswords no #不允许空密码登录
PasswordAuthentication yes # 设置是否使用口令验证。

记得修改完配置文件后,重新启动sshd服务器(/etc/rc.d/sshd restart)即可。

标签: freebsd

添加新评论