1.  ssh服务器配置

服务器端:sshd

服务器端的配置文件: /etc/ssh/sshd_config

服务器端的配置文件帮助:man 5 sshd_config

ssh相关工具_配置文件

常用参数:

Port
ListenAddress ip
LoginGraceTime 2m #你连接以后一直不输入密M,最多等待的时间
PermitRootLogin yes #默认ubuntu不允许root远程ssh登录
StrictModes yes #检查.ssh/文件的所有者,权限等
MaxAuthTries 6 #
MaxSessions 10 #同一个连接最大会话
PubkeyAuthentication yes #基于key验证
PermitEmptyPasswords no #空密M连接
PasswordAuthentication yes #基于用户名和密连接
GatewayPorts no
ClientAliveInterval 10 ClientAliveCountMax 3
#单位:秒
#默认3
UseDNS yes
GSSAPIAuthentication yes
#提高速度可改为no
#提高速度可改为no
MaxStartups
#未认证连接最大值,默认值10
Banner /path/file
#以下可以限制可登录用户的办法:
AllowUsers user1 user2 user3
DenyUsers
AllowGroups
DenyGroups