`
guohf
  • 浏览: 414826 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

FreeBSD下SSH安装配置

阅读更多

sshd的配置文件一般位于/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

  (Linux上默认允许root用户登录,此处可不修改。)

  修改完成后重启sshd:

  /etc/rc.d/sshd restart

/etc/rc.conf 中,添加一个:

sshd_enable="yes"

 

FreeBSD SSH配置详解  
首先vi编辑/etc/inetd.conf,去掉ssh前的#,保存退出
编辑/etc/rc.conf
最后加入:sshd_enable="yes"即可
激活sshd服务:
techo#/etc/rc.d/sshd start
用下面命令检查服务是否启动,在22端口应该有监听。
#netstat -an ## check port number 22
最后
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
#Protocol 2
#AddressFamily any
#ListenAddress 10.1.10.196
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKey .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# Change to yes to enable built-in password authentication.
PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable PAM authentication
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'no' to disable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM yes

#AllowTcpForwarding yes
#GatewayPorts no
Forwarding yes
DisplayOffset 10
UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server

IgnoreRhosts yes
IgnoreUserKnownHosts yes
PrintMotd yes
StrictModes no
RSAAuthentication yes
PermitRootLogin yes #允许root登录
PermitEmptyPasswords no #不允许空密码登录
PasswordAuthentication yes # 设置是否使用口令验证。

##############################################

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

分享到:
评论

相关推荐

    FreeBSD 8.0 配置密钥登录

    本文将详细介绍如何在FreeBSD 8.0系统中配置SSH服务以支持密钥登录。 #### 一、概述 在FreeBSD 8.0系统中,通过SSH(Secure Shell)协议进行远程管理是一种非常重要的手段。SSH协议提供了加密的数据通信方式,可以...

    freeBSD远程安装

    本文将详细介绍如何在远程控制台不可用的情况下进行FreeBSD的远程安装。 #### 2. 简介 ##### 2.1 目的与适用范围 本文旨在为那些使用不支持FreeBSD的托管设施提供的服务的人提供指导。我们将通过一系列步骤展示...

    FreeBSD7.0邮件服务器安装向导

    ### FreeBSD 7.0 邮件服务器安装与配置指南 #### 一、安装FreeBSD 在安装FreeBSD 7.0之前,首先需要选择一个合适的安装方式。本指南建议选择自定义安装(custom installation),这可以确保安装过程中只包含必要的...

    FreeBSD配置防火墙开启SSH服务的方法.docx

    FreeBSD配置防火墙开启SSH服务的方法 FreeBSD作業系統是一個免費的開源作業系統,具有高安全性和穩定性。為了保護作業系統的安全,FreeBSD提供了一個防火墙系統,稱為ipfw。ipfw是一個基于规则的防火墙,可以根據...

    FreeBSD 安装说明

    **FreeBSD 安装与配置指南** FreeBSD是一款开源、免费的类Unix操作系统,以其稳定性和安全性著称。本文将详细介绍在AMD64(x86_64)平台上安装FreeBSD 8.2-RELEASE的过程,以及后续的系统配置。 ### 1. 获取安装...

    FreeBSD安装设置大全(中文版)

    这份“FreeBSD安装设置大全”旨在为用户提供详尽的指南,帮助他们顺利地安装和配置FreeBSD系统。无论你是初学者还是经验丰富的系统管理员,都可以通过这份资料深入理解FreeBSD的安装过程和后期设置。 **一、FreeBSD...

    ansible-freebsd-postinstall:角色扮演。 FreeBSD的安装后配置

    FreeBSD安装后配置:别名,apcupsd,授权密钥,cron,devfs,fstab,组,hostapd,主机名,主机,libmap,linux兼容性,login.conf,loader.conf,make.conf,motd,nfsd,ntpd, ntpdate,procmail,resolvconf....

    FreeBSD Rsync同步学习与配置全过程

    FreeBSD上的Rsync同步学习与配置是一个重要的话题,特别是对于那些需要高效、可靠地备份和同步数据的系统管理员而言。Rsync是一款强大的文件同步工具,最初设计用来替代rcp,由rsync.samba.org维护。它以其独特的...

    FreeBSD 7.0 全程图解安装手册

    11. **服务配置**:可选择配置系统服务,如SSH(远程登录服务),以及FTP、NFS等服务的开启与否。 12. **时间设置**:确保设置正确的时间,这对于系统日志和同步至关重要。 安装完成后,系统将进行首次启动,这时你...

    FreeBSD服务器安装.doc

    本文档将指导您安装FreeBSD服务器,整个安装过程分为几个步骤,包括光盘安装、磁盘分区、安装类型选择、网络配置、系统设置等。 步骤1: 光盘安装 1. 准备好刻录好的 FreeBSD 6.2-RELEASE-i386-disc1.iso 光盘。 2....

    freeBSD架设管理与应用

    一、FreeBSD安装与系统配置 1. 安装流程:FreeBSD提供了多种安装方式,包括光盘、USB设备、网络安装等。用户可以根据自己的硬件环境选择最适合的安装方法。 2. 分区规划:合理规划硬盘分区对于系统的高效运行至关...

    FreeBSD 8.1使用手册

    这份2010年更新的"FreeBSD 8.1使用手册"是针对该版本的重要参考资料,旨在帮助用户理解和掌握FreeBSD 8.1系统的安装、配置、管理及优化。 一、安装与升级 在FreeBSD 8.1中,安装过程可以通过图形化的安装程序或...

    安装ssh方法

    SSH,全称Secure Shell,是一种网络协议,用于在不安全的网络环境中...无论你是在Linux、macOS还是Windows系统上,安装和配置SSH都是实现安全远程访问的第一步。确保正确配置和使用SSH,能极大地提升你的网络安全性。

    freebsd教程

    1. **安装FreeBSD**:包括准备安装介质、选择安装类型(例如,UFS或ZFS文件系统)、分区策略、网络配置等步骤。 2. **基本操作与管理**:如使用命令行界面,理解shell语法,管理用户和权限,以及使用pkgng包管理...

    FreeBSD图解安装

    本文将详细介绍如何进行FreeBSD 8.0的图解安装。 首先,在安装前需要做一些准备工作。确保你有一台满足最低配置要求的机器,包括CPU至少为P3 800MHz,内存至少256MB,以及2-3块网卡,最好是Intel品牌。硬盘空间没有...

Global site tag (gtag.js) - Google Analytics