suse10如何配置/etc/ssh/sshd

60次阅读
没有评论

共计 2247 个字符,预计需要花费 6 分钟才能阅读完成。

丸趣 TV 小编给大家分享一下 suse10 如何配置 /etc/ssh/sshd_config 文件,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

“/etc/ssh/sshd_config”是 OpenSSH 的配置文件,允许设置选项改变这个 daemon 的运行。这个文件的每一行包含“关键词- 值”的匹配,其中“关键词”是忽略大小写的。下面列出来的是最重要的关键词,用 man 命令查看帮助页(sshd (8))可以得到详细的列表。

编辑“sshd_config”文件(vi /etc/ssh/sshd_config),加入或改变下面的参数:

# This is ssh server systemwide configuration file.
Port 22
ListenAddress 192.168.1.1
HostKey /etc/ssh/ssh_host_key
ServerKeyBits 1024
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin no
IgnoreRhosts yes
IgnoreUserKnownHosts yes
StrictModes yes
X11Forwarding no
PrintMotd yes
SyslogFacility AUTH
LogLevel INFO
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords no
AllowUsers admin

下面逐行说明上面的选项设置:

Port 22
 “Port”设置 sshd 监听的端口号。

ListenAddress 192.168.1.1
 “ListenAddress”设置 sshd 服务器绑定的 IP 地址。

HostKey /etc/ssh/ssh_host_key

 “HostKey”设置包含计算机私人密匙的文件。

ServerKeyBits 1024
 “ServerKeyBits”定义服务器密匙的位数。

LoginGraceTime 600
 “LoginGraceTime”设置如果用户不能成功登录,在切断连接之前服务器需要等待的时间(以秒为单位)。

KeyRegenerationInterval 3600
 “KeyRegenerationInterval”设置在多少秒之后自动重新生成服务器的密匙(如果使用密匙)。重新生成密匙是为了防止用盗用的密匙解密被截获的信息。

PermitRootLogin no
 “PermitRootLogin”设置 root 能不能用 ssh 登录。这个选项一定不要设成“yes”。

IgnoreRhosts yes
 “IgnoreRhosts”设置验证的时候是否使用“rhosts”和“shosts”文件。

IgnoreUserKnownHosts yes
 “IgnoreUserKnownHosts”设置 ssh daemon 是否在进行 RhostsRSAAuthentication 安全验证的时候忽略用户的“$HOME/.ssh/known_hosts”

StrictModes yes
 “StrictModes”设置 ssh 在接收登录请求之前是否检查用户家目录和 rhosts 文件的权限和所有权。这通常是必要的,因为新手经常会把自己的目录和文件设成任何人都有写权限。

X11Forwarding no
 “X11Forwarding”设置是否允许 X11 转发。

PrintMotd yes
 “PrintMotd”设置 sshd 是否在用户登录的时候显示“/etc/motd”中的信息。

SyslogFacility AUTH
 “SyslogFacility”设置在记录来自 sshd 的消息的时候,是否给出“facility code”。

LogLevel INFO
 “LogLevel”设置记录 sshd 日志消息的层次。INFO 是一个好的选择。查看 sshd 的 man 帮助页,已获取更多的信息。

RhostsAuthentication no
 “RhostsAuthentication”设置只用 rhosts 或“/etc/hosts.equiv”进行安全验证是否已经足够了。

RhostsRSAAuthentication no
 “RhostsRSA”设置是否允许用 rhosts 或“/etc/hosts.equiv”加上 RSA 进行安全验证。

RSAAuthentication yes
 “RSAAuthentication”设置是否允许只有 RSA 安全验证。

PasswordAuthentication yes
 “PasswordAuthentication”设置是否允许口令验证。

PermitEmptyPasswords no
 “PermitEmptyPasswords”设置是否允许用口令为空的帐号登录。

AllowUsers admin
 “AllowUsers”的后面可以跟着任意的数量的用户名的匹配串(patterns)或 user@host 这样的匹配串,这些字符串用空格隔开。主机名可以是 DNS 名或 IP 地址。

以上是“suse10 如何配置 /etc/ssh/sshd_config 文件”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-25发表,共计2247字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)