ssh配置文件详情

一.常见信息:

Port 22  端口

ListenAddress  监听的IP

Protocol 2 SSH版本选择,选择2即可

HostKey /etc/ssh/ssh_host_rsa__key 私钥保存位置

ServerKeyBits  大小1024

ServerFacility AUTH  日志记录ssh登陆情况

#KeyRegenerationInterval 1h  重新生成服务器密钥的周期

#ServerKeyBits 1024  服务器密钥的长度

LogLevel INFO 记录sshd日志消息的级别

#PermitRootLogin yes  是否允许root远程ssh登录

#RSAAuthentication yes  设置是否开启ras密钥登录方式

#PubkeyAuthentication yes  设置是否开启公钥验登录方式

#AuthorizedKeysFile .ssh/authorized_keys  设置公钥验证文件的路径

#PermitEmptyPasswords no  设置是否允许空密码的账号登录

X11Forwarding yes  设置是否允许X11转发

GSSAPIAuthentication yes  GSSAPI认证开启

二:修改端口号

port 211 

三.服务器端安全配置选项

PermitRootLogin yes #允许root的ssh登陆
PubkeyAuthentication yes #是否使用公钥验证
AuthorizeKeysFile .ssh/authorized_keys #公钥的保存位置
PasswordAuthentication yes #允许使用密码验证登陆
PermitEmptyPasswords no #不允许空密码登陆

四.重启systemctl restart sshd.service

五.拼接ssh

ssh root@ip

posted @ 2021-03-17 00:42  ocean0327  阅读(79)  评论(0编辑  收藏  举报