freebsd ssh配置 2011-08-22 15:35:32

分类: 系统运维


freebsd 默认是不允许ssh登录的
说以说要设置一下,我的版本是8.2的从网上的一个博客中获得了信息然后成功了 http://likuan4168.blog.163.com/blog/static/3845719020091261139372/
FreeBSD SSH配置详解
1.首先vi编辑/etc/inetd.conf,去掉ssh前的#,保存退出  
2.编辑/etc/rc.conf  
最后加入:sshd_enable="yes"即可  
3.激活sshd服务:  
#/etc/rc.d/sshd start  
用下面命令检查服务是否启动,在22端口应该有监听。  
#netstat -an  
4.vi /etc/ssh/sshd_config,
下面是配置文档:(/etc/ssh/sshd_config)  
####################################################  
# $OpenBSD: sshd_config,v 1.72 2005/07/25 11:59:40 markus Exp $  
# $FreeBSD: src/crypto/openssh/sshd_config,v 1.42.2.1 2005/09/11 16:50:35 des Exp $  
# This is the sshd server system-wide configuration file. See  
# sshd_config(5) for more information.  
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin  
# The strategy used for options in the default sshd_config shipped with  
# OpenSSH is to specify options with their default value where  
# possible, but leave them commented. Uncommented options change a  
# default value.  
# Note that some of FreeBSD’s defaults differ from OpenBSD’s, and  
# FreeBSD has a few additional options.  
#VersionAddendum FreeBSD-20050903  
#Port 22  
Subsystem sftp /usr/libexec/sftp-server  
IgnoreRhosts yes  
IgnoreUserKnownHosts yes  
PrintMotd yes  
StrictModes no  
RSAAuthentication yes  
PermitRootLogin yes #允许root登录  
PermitEmptyPasswords no #不允许空密码登录  
PasswordAuthentication yes # 配置是否使用口令验证。  
##############################################  
(注:用查找发只修改上面#后面有汉字说明的3个地方,其他的都按照配置来
记得修改完配置文档后,重新启动sshd服务器即可。
5.#/etc/rc.d/sshd restart
6.在windows下使用SecureCRT来进行连接就可以连接上了。。同时用SecureFx也可以传输文件了。。