www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

ssh 限制 ip 及用户密钥认证登录

cat /etc/ssh/sshd_config | grep -v "#"




Port 5222
AllowUsers root@60.174.20 dbs@60.174.2084 db@60.1184 root@36.7.1179 dbs@36.7.132.179 db@36.7.13 root@172.23.170.81 root@172.23.170.80 root@172.23.179 root@localhost

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key








PubkeyAuthentication yes

AuthorizedKeysFile ~/.ssh/authorized_keys /home/dbs/.ssh/authorized_keys






ChallengeResponseAuthentication no


GSSAPIAuthentication yes
GSSAPICleanupCredentials no

UsePAM yes

X11Forwarding yes

PrintMotd no



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

Subsystem sftp  /usr/libexec/openssh/sftp-server


UseDNS no
SyslogFacility AUTHPRIV
PermitRootLogin yes
PasswordAuthentication no

 

cat /etc/ssh/sshd_config | grep -v "#"



Port 5222AllowUsers root@60.174.203.184 dbs@60.174.203.184 db@60.174.203.184 root@36.7.132.179 dbs@36.7.132.179 db@36.7.132.179 root@172.23.170.81 root@172.23.170.80 root@172.23.170.79 root@localhost
HostKey /etc/ssh/ssh_host_rsa_keyHostKey /etc/ssh/ssh_host_ecdsa_keyHostKey /etc/ssh/ssh_host_ed25519_key







PubkeyAuthentication yes
AuthorizedKeysFile ~/.ssh/authorized_keys /home/dbs/.ssh/authorized_keys





ChallengeResponseAuthentication no

GSSAPIAuthentication yesGSSAPICleanupCredentials no
UsePAM yes
X11Forwarding yes
PrintMotd no


AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGESAcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENTAcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGEAcceptEnv XMODIFIERS
Subsystem sftp  /usr/libexec/openssh/sftp-server

UseDNS noSyslogFacility AUTHPRIVPermitRootLogin yesPasswordAuthentication no
posted on 2026-05-12 16:07  秦瑞It行程实录  阅读(14)  评论(0)    收藏  举报
www.cnblogs.com/ruiyqinrui