ssh配置文件詳情

一.常見信息:安全

Port 22  端口服務器

ListenAddress  監聽的IPssh

Protocol 2 SSH版本選擇,選擇2便可ide

HostKey /etc/ssh/ssh_host_rsa__key 私鑰保存位置rest

ServerKeyBits  大小1024日誌

ServerFacility AUTH  日誌記錄ssh登錄狀況ip

#KeyRegenerationInterval 1h  從新生成服務器密鑰的週期ci

#ServerKeyBits 1024  服務器密鑰的長度it

LogLevel INFO 記錄sshd日誌消息的級別io

#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

相關文章
相關標籤/搜索