- 浏览: 2140154 次
- 性别:
- 来自: 合肥
文章分类
- 全部博客 (401)
- Agile (16)
- Apache Commons (3)
- Architecture (8)
- DB.MongoDB (5)
- DB.Mysql (3)
- DB.Oracle (34)
- DirectoryService (1)
- DotNet (1)
- English (3)
- Groovy (0)
- Html (28)
- Java (67)
- Java.Aixs (7)
- Java.Cache (2)
- Java.jPBM (1)
- Java.Resin (6)
- Java.Spring (4)
- Java.Struts2 (5)
- Java.Tomcat (16)
- Javascript (45)
- Javascript.Google Map (2)
- Javascript.Jquery (8)
- Life (15)
- Maven&Ant (4)
- Network (5)
- OS.Linux (45)
- OS.Windows (10)
- OS.Windows.Office (1)
- PlayFramework (15)
- Python (28)
- Reading notes (11)
- Security (13)
- Server.Apache (3)
- Server.Nginx (7)
- Test (6)
- Tool (15)
- Work.Solution (15)
- Other (20)
- SSO&CAS&Identity (13)
最新评论
-
hutuxiansheng123:
防火墙、Iptables、netfilter/iptables、NAT 概述 -
dacoolbaby:
非常棒的正则表达式,非常适用。万分感谢。
用python分析nginx的access日志 -
loot00:
您好! 我也遇到了相同的错误信息。我是用f_link_lob ...
LOB variable no longer valid after subsequent fetch -
feihangchen:
@OnApplicationStop public clas ...
Play framework 1.2.3 Jobs定时任务、异步任务、引导任务、触发任务、关闭任务 -
洞渊龙王:
谢谢了
www.w3.org被qiang导致logback报错:Connect reset
转自:sshd_config配置 详解
基本上,在您的系统中,『除非有必要,否则请不要更改 /etc/ssh/sshd_config 这个档案的设定值!』因为预设的情况下通常都是最严密的 SSH 保护了,因此,可以不需要更动他!上面的说明仅是在让大家了解每个细项的一些基本内容而已!
另外,如果您修改过上面这个档案(/etc/ssh/sshd_config),那么就必需要重新启动一次 sshd 这个 daemon 才行!亦即是:/etc/rc.d/init.d/sshd restart(service sshd restart)
man sshd_config:查看随机帮组文档
sshd_config 中文手册
# 1. 关于 SSH Server 的整体设定,包含使用的 port 啦,以及使用的密码演算方式 Port 22 # SSH 预设使用 22 这个 port,您也可以使用多的 port ! # 亦即重复使用 port 这个设定项目即可! Protocol 2,1 # 选择的 SSH 协议版本,可以是 1 也可以是 2 , # 如果要同时支持两者,就必须要使用 2,1 这个分隔了! #ListenAddress 0.0.0.0 # 监听的主机适配卡!举个例子来说,如果您有两个 IP, # 分别是 192.168.0.100 及 192.168.2.20 ,那么只想要 # 开放 192.168.0.100 时,就可以写如同下面的样式: ListenAddress 192.168.0.100 # 只监听来自 192.168.0.100 这个 IP 的SSH联机。 # 如果不使用设定的话,则预设所有接口均接受 SSH PidFile /var/run/sshd.pid # 可以放置 SSHD 这个 PID 的档案!左列为默认值 LoginGraceTime 600 # 当使用者连上 SSH server 之后,会出现输入密码的画面, # 在该画面中,在多久时间内没有成功连上 SSH server , # 就断线!时间为秒! Compression yes # 是否可以使用压缩指令?当然可以啰! # 2. 说明主机的 Private Key 放置的档案,预设使用下面的档案即可! HostKey /etc/ssh/ssh_host_key # SSH version 1 使用的私钥 HostKey /etc/ssh/ssh_host_rsa_key # SSH version 2 使用的 RSA 私钥 HostKey /etc/ssh/ssh_host_dsa_key # SSH version 2 使用的 DSA 私钥 # 2.1 关于 version 1 的一些设定! KeyRegenerationInterval 3600 # 由前面联机的说明可以知道, version 1 会使用 # server 的 Public Key ,那么如果这个 Public # Key 被偷的话,岂不完蛋?所以需要每隔一段时间 # 来重新建立一次!这里的时间为秒! ServerKeyBits 768 # 没错!这个就是 Server key 的长度! # 3. 关于登录文件的讯息数据放置与 daemon 的名称! SyslogFacility AUTH # 当有人使用 SSH 登入系统的时候,SSH会记录资 # 讯,这个信息要记录在什么 daemon name 底下? # 预设是以 AUTH 来设定的,即是 /var/log/secure # 里面!什么?忘记了!回到 Linux 基础去翻一下 # 其它可用的 daemon name 为:DAEMON,USER,AUTH, # LOCAL0,LOCAL1,LOCAL2,LOCAL3,LOCAL4,LOCAL5, LogLevel INFO # 登录记录的等级!嘿嘿!任何讯息! # 同样的,忘记了就回去参考! # 4. 安全设定项目!极重要! # 4.1 登入设定部分 PermitRootLogin no # 是否允许 root 登入!预设是允许的,但是建议设定成 no! UserLogin no # 在 SSH 底下本来就不接受 login 这个程序的登入! StrictModes yes # 当使用者的 host key 改变之后,Server 就不接受联机, # 可以抵挡部分的木马程序! #RSAAuthentication yes # 是否使用纯的 RSA 认证!?仅针对 version 1 ! PubkeyAuthentication yes # 是否允许 Public Key ?当然允许啦!只有 version 2 AuthorizedKeysFile .ssh/authorized_keys # 上面这个在设定若要使用不需要密码登入的账号时,那么那个 # 账号的存放档案所在档名! # 4.2 认证部分 RhostsAuthentication no # 本机系统不止使用 .rhosts ,因为仅使用 .rhosts 太 # 不安全了,所以这里一定要设定为 no ! IgnoreRhosts yes # 是否取消使用 ~/.ssh/.rhosts 来做为认证!当然是! RhostsRSAAuthentication no # 这个选项是专门给 version 1 用的,使用 rhosts 档案在 # /etc/hosts.equiv配合 RSA 演算方式来进行认证!不要使用 HostbasedAuthentication no # 这个项目与上面的项目类似,不过是给 version 2 使用的! IgnoreUserKnownHosts no # 是否忽略家目录内的 ~/.ssh/known_hosts 这个档案所记录 # 的主机内容?当然不要忽略,所以这里就是 no 啦! PasswordAuthentication yes # 密码验证当然是需要的!所以这里写 yes 啰! PermitEmptyPasswords no # 若上面那一项如果设定为 yes 的话,这一项就最好设定 # 为 no ,这个项目在是否允许以空的密码登入!当然不许! ChallengeResponseAuthentication yes # 挑战任何的密码认证!所以,任何 login.conf # 规定的认证方式,均可适用! #PAMAuthenticationViaKbdInt yes # 是否启用其它的 PAM 模块!启用这个模块将会 # 导致 PasswordAuthentication 设定失效! # 4.3 与 Kerberos 有关的参数设定!因为我们没有 Kerberos 主机,所以底下不用设定! #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosTgtPassing no # 4.4 底下是有关在 X-Window 底下使用的相关设定! X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes # 4.5 登入后的项目: PrintMotd no # 登入后是否显示出一些信息呢?例如上次登入的时间、地点等 # 等,预设是 yes ,但是,如果为了安全,可以考虑改为 no ! PrintLastLog yes # 显示上次登入的信息!可以啊!预设也是 yes ! KeepAlive yes # 一般而言,如果设定这项目的话,那么 SSH Server 会传送 # KeepAlive 的讯息给 Client 端,以确保两者的联机正常! # 在这个情况下,任何一端死掉后, SSH 可以立刻知道!而不会 # 有僵尸程序的发生! UsePrivilegeSeparation yes # 使用者的权限设定项目!就设定为 yes 吧! MaxStartups 10 # 同时允许几个尚未登入的联机画面?当我们连上 SSH , # 但是尚未输入密码时,这个时候就是我们所谓的联机画面啦! # 在这个联机画面中,为了保护主机,所以需要设定最大值, # 预设最多十个联机画面,而已经建立联机的不计算在这十个当中 # 4.6 关于使用者抵挡的设定项目: DenyUsers * # 设定受抵挡的使用者名称,如果是全部的使用者,那就是全部 # 挡吧!若是部分使用者,可以将该账号填入!例如下列! DenyUsers test DenyGroups test # 与 DenyUsers 相同!仅抵挡几个群组而已! # 5. 关于 SFTP 服务的设定项目! Subsystem sftp /usr/lib/ssh/sftp-server
基本上,在您的系统中,『除非有必要,否则请不要更改 /etc/ssh/sshd_config 这个档案的设定值!』因为预设的情况下通常都是最严密的 SSH 保护了,因此,可以不需要更动他!上面的说明仅是在让大家了解每个细项的一些基本内容而已!
另外,如果您修改过上面这个档案(/etc/ssh/sshd_config),那么就必需要重新启动一次 sshd 这个 daemon 才行!亦即是:/etc/rc.d/init.d/sshd restart(service sshd restart)
man sshd_config:查看随机帮组文档
sshd_config 中文手册
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin # 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. #Port 22 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: # Disable legacy (protocol version 1) support in the server for new # installations. In future the default will change to require explicit # activation of protocol 1 Protocol 2 # HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 #HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_dsa_key # Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 1024 # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH SyslogFacility AUTHPRIV #LogLevel INFO # Authentication: #LoginGraceTime 2m #PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 #RSAAuthentication yes #PubkeyAuthentication yes #AuthorizedKeysFile .ssh/authorized_keys #AuthorizedKeysCommand none #AuthorizedKeysCommandRunAs nobody # 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 # To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #PermitEmptyPasswords no PasswordAuthentication yes # Change to no to disable s/key passwords #ChallengeResponseAuthentication yes ChallengeResponseAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no GSSAPIAuthentication yes #GSSAPICleanupCredentials yes GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. #UsePAM no UsePAM yes # Accept locale-related environment variables AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE AcceptEnv XMODIFIERS #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no #X11Forwarding no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #ShowPatchLevel no #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10 #PermitTunnel no #ChrootDirectory none # no default banner path #Banner none # override default of no subsystems Subsystem sftp /usr/libexec/openssh/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # ForceCommand cvs server
发表评论
-
openssl 非对称加密DSA,RSA区别与使用介绍(转)
2012-10-26 16:42 14114在日常系统管理工作中,需要作一些加解密的工作,通过openss ... -
Virtualbox下为CentOS增加新硬盘、Linux添加新硬盘、vsftp配置用户磁盘配额(磁盘限额)
2012-09-27 16:29 4212增加新磁盘: 1,关闭CentOS系统(如果不关闭cento ... -
加密ssl vsftp、ftp隐式加密&显式加密
2012-09-27 14:30 9305FTP over SSL (Implicit)隐式ssl与FT ... -
(转)vsftp详细配置、/etc/vsftpd/vsftpd.conf
2012-09-26 15:26 12204匿名用户权限控制: ano ... -
CentOS下vsftp设置、匿名用户&本地用户设置、PORT、PASV模式设置
2012-09-26 14:22 648731, 安装:yum install vsftp ... -
sftp配置
2012-09-25 09:34 20742限制sftp用户(必须是操作系统用户)的访问权限 不设置Chr ... -
ftp、sftp、scp、ssh、openssh
2012-09-24 10:11 21316FTP(File Transfer Protocol) ... -
Linux time命令、dd命令、测试硬盘读写速度、磁盘备份恢复
2012-09-12 10:08 6083time命令常用于测量一个 ... -
NFS安装配置及常见问题、/etc/exports配置文件、showmount命令
2012-09-11 09:25 930891,服务器端软件:安装nfs-utils和portmap(rp ... -
网络文件系统(Network File System,NFS)、NFS安全配置相关、NFS相关端口及防火墙设置
2012-09-10 14:35 1687网络文件系统(Network File System,NFS ... -
(转)udev、给硬盘分配固定设备名(符号链接)
2012-09-10 13:45 8166man udev - 动态设备管理 為什麼採用 udev(s ... -
linux网络配置相关命令、虚拟网络接口eth0:0
2012-09-06 10:11 32083网络接口(interface)是网络硬件设备在操作系统中的表示 ... -
linux网络配置相关文件
2012-09-05 16:35 1875网络接口(interface)是网 ... -
Linux man命令、帮助文档Section
2012-09-05 14:34 4718linux man的常用用法: man section cmd ... -
Linux安装源码包
2012-09-04 14:39 6412在linux下面安装一个源码包是最常用的,笔者在日常的管理工作 ... -
(转)如何查看Linux 硬件配置信息、dmesg命令、Linux版本
2012-08-31 14:06 2851转自:如何查看Linux 硬件配置信息 机器中所有可用网卡及 ... -
Linux常见设备及相应/dev/xxx文件名、Mount Point、挂载点、Mount命令、fstab、挂载分区
2012-08-31 11:18 11652Linux 中的设备有2种类型 ... -
VirtualBox 4.1安装CentOS6 Server版 - 问题记录、Linux Mount点
2012-08-31 09:51 75861,CentOS系统下载页面htt ... -
x86,I386,i686, x86_64, x64,amd64、Windows Linux AIX下查看CPU位数和操作系统位数、rpm包名
2012-08-29 11:12 12401a2ps-4.13b-57.2.el5.i386.rpm ... -
Yum install man、Yum仓库(CentOS-Base.repo)、本地yum仓库
2012-08-28 15:27 13496CentOS版本查看: cat /etc/*release* ...
相关推荐
sshd_config默认配置
sshd默认从 /etc/ssh/sshd_config 文件(或通过 -f 命令行选项指定的文件)读取配置信息。配置文件是由"指令 值"对组成的,每行一个。空行和以'#'开头的行都将被忽略。如果值中含有空白符或者其他特殊符号,那么可以...
sshd_config配置说明:sshd_config - OpenSSH SSH 服务器守护进程配置文件
linux /etc/ssh/sshd_config文件 该文件是为了对用户组进行管理 # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ # This is the sshd server system-wide configuration file. See # sshd...
linux的ssh远程连接协议中的配置文件sshd_config
ssh_config 希望对你有用!
不幸的是, sshd_config文件的解析器无法检测到错误输入的配置选项或设置,这些配置选项或设置可能会让您的系统对攻击者开放。 sshd-lint检查sshd_config文件是否符合安全性最佳实践。 它警告有关重复的配置行,...
echo "备份sshd_config配置文件及sshd_pam文件" cp /etc/ssh/sshd_config /etc/ssh/sshd_config_7.4p1_bak cp /etc/pam.d/sshd /etc/ssh/sshd_7.4p1_pam_bak rpm -Uvh openssh-*.rpm chmod 0600 /etc/ssh/ssh_host_*...
一:修改/etc/ssh/sshd_config配置文件(注意:这里是sshd_config,而不是ssh_config) 1:查看ssh的默认端口号 netstat -anp|grep ssh 2:修改/etc/ssh/sshd_config配置文件 在sshd_config文件中添加一个端口号...
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.rpmsave rm -rf /etc/ssh/sshd_config mv /etc/ssh/sshd_config.rpmnew /etc/ssh/sshd_config vim /etc/ssh/sshd_config #新加入一行: PermitRootLogin yes # 保存 ...
点文件 ... 检查/ etc / ssh / sshd_config文件,以确保/etc/profile.d文件夹下的所有.sh文件都已执行。 设置.bashrc,.bashprofile,.gitconfig,.dircolors的步骤: ln -s〜/ dotfiles / .bashrc〜/
SSH Config Editor Mac版是一款macOS平台的ssh配置文件管理工具,SSH Config Editor Mac版可以帮助我们在 mac电脑上管理ssh配置文件,我们可以通过这款软件添加或是修改SSH配置文件、添加或是修改端口转发规则、RSA...
报错159行有问题,将/etc/ssh/sshd_config第159行配置注释掉。 cat -n /etc/ssh/sshd_config|grep GSSAPIKexAlgorithms 159 #GSSAPIKexAlgorithms gss-group14-sha256-,gss-group16-sha512-,gss-curve25519-sha256...
cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.old rpm -Uvh ./*.rpm 升级完记得恢复配置与删除原来openssh生成的key rm -rf /etc/ssh/ssh_host_*key cat /etc/pam.d/sshd.old > /etc/pam.d/sshd cat /etc/...
cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.old # 升级 rpm -Uvh ./openssh*.rpm # 清除之前形成的key文件 rm -rf /etc/ssh/ssh_host_*key # 恢复之前的openssh配置 cat /etc/pam.d/sshd.old > /etc/pam.d/...
修改 /etc/ssh/sshd_config文件权限 ①进入 /etc/ssh/, 执行命令:cd /etc/ssh/ ②并修改sshd_config文件权限, 执行命令:chmod 777 sshd_config ③进入编辑模式 执行命令:vi sshd_config ④找到permitRootLogin ...