03-SSH server config
来源:互联网 发布:办公室暧昧 知乎 编辑:程序博客网 时间:2024/05/16 06:51
03-SSH server config
sshd服务器端配置
[root@husa ssh]# pwd/etc/ssh[root@husa ssh]# lsmoduli ssh_host_ecdsa_key ssh_host_ed25519_key.pubssh_config ssh_host_ecdsa_key.pub ssh_host_rsa_keysshd_config ssh_host_ed25519_key ssh_host_rsa_key.pub
其中的公钥私钥用于做主机认证
sshd_config文件field explanation
#Port 22 #端口号#AddressFamily any #监听的socket类型,ipv4,ipv6#ListenAddress 0.0.0.0 #监听的主机的IP地址#ListenAddress :: #Protocol 2 #ssh版本#KeyRegenerationInterval 1h #密钥每隔多长时间更新一次#ServerKeyBits 1024 #密钥长度SyslogFacility AUTHPRIV #日志级别#LoginGraceTime 2m #登陆的宽限期,这里是2min#PermitRootLogin yes #是否允许管理员直接登陆#StrictModes yes #是否使用严格模式#MaxAuthTries 6 #最大认证尝试次数#MaxSessions 10 #最大连接数#HostbasedAuthentication no #要不要对主机进行密钥认证#PasswordAuthentication yes #是否允许基于口令认证#PermitEmptyPasswords no #是否允许空密码ChallengeResponseAuthentication no #是否启用对密钥认证的密钥 加密X11Forwarding yes #是否启用X11转发#PrintMotd yes #登陆时是否打印/etc/motd文件#PrintLastLog yes #登陆时是否打印上次登录信息#UseDNS yes #是否通过DNS把client的IP反解为主机名Subsystem sftp /usr/libexec/openssh/sftp-server #sftp子系统#---------------------------------------------##AllowUsers users... #表示允许登陆的用户#AllowGroups grps... #表示允许登陆的组#DenyUsers users... #拒绝#DenyGroups grps... #
SSH最佳实践
1、禁止使用默认端口2、禁止使用protocol version 13、显示可登录用户4、设定空闲会话超时时长5、利用防火墙设置ssh访问策略6、进监听特定的IP地址7、基于口令认证时,使用强密码策略8、使用基于密钥的认证9、禁止使用空密码10、禁止root用户直接登陆11、限制ssh的访问频度和并发在线数12、做好日志,经常分析 /var/log/sercure
-
生成随机密码的方式
```[root@husa ~]# openssl rand -base64 207lMw+ebwIN1Gabie4rdiOJUfQ6o=[root@husa ~]# tr -dc A-Za-z0-9_ < /dev/urandom | head -c 30 | xargsZT9rALlH1Go4OsghRGwi1hCYi_PTrl```
0 0
- 03-SSH server config
- ssh-server-config
- .ssh/config
- Config server
- config-server
- ssh config info
- .ssh/config作用
- hadoop cygwin ssh config
- auto config ssh equivalency
- ssh config文件
- SSH with config
- Linux SSH config设置
- Linux - ssh config
- Default SSH Config
- ssh-config配置
- 配置ssh/config
- ssh配置config文件
- Spring Cloud Config Server基于本地git使用SSH clone github repository
- 显著性检测算法学习阶段论文总结(3)
- android 自定义控件以及自定义view学习(随机验证码生成)
- MultipeerConnectivity(简介)
- 02-SSH
- 直接插入排序
- 03-SSH server config
- hdu 3308 LCIS
- APP开发外包注意事项有哪些?
- Centos搭建SVN服务器及配置文件(主要讲配置)
- hadoop - hadoop2.6 伪分布式 示例 wordcount 分词 和 hdfs常用操作命令
- ZJU1067- Color Me Less
- 2016 GDUT Individual Contest2_A题_codeforces 416A(双指针)
- caffe示例实现之13编辑模型参数
- 用win 7 32位 cmake2.8+VTK6.2+VS2012配置