SSH遠端管理

2021-09-27 05:01:45 字數 1451 閱讀 3246

一.ssh介紹

ssh( shell)是一種安全通道協議,主要用來實現字元介面的遠端登入、

遠端複製等功能。ssh協議對通訊雙方的資料傳輸進行了處理,其中包括使用者登入時輸入的使用者口令。與早期的 telnet(遠端登入)、rsh( remote shell,遠端執行命令)、rcp(remote file copy,遠端檔案複製)等應用相比ssh協議提供了更好的安全性.

二.ssh服務及配置檔案

1.ssh服務配置檔案預設位於 /etc/ssh/sshd_config目錄下。

服務監聽選項

1 port 22 //監聽的埠號為22

2 protocol 2 //使用ssh v2協議

3 listenadderss 0.0.0.0 //監聽的位址為所有的位址

4 userdns no //禁止dns反向解析

使用者登入控制

1 permitrootlogin no // 禁止root使用者登入

2 permitemptypasswords no // 禁止使用者登入

3 logingracetime 2m // 登入驗證時間為2分鐘

4 maxauthtries 6 // 最大重試次數6次

5 allowusers steven // 只允許steven使用者登入

6 denyusers steven // 不允許登入使用者 steven

登入驗證方式

1 passwordauthentication yes //啟用金鑰

2 pubkeyauthentication yes //啟用金鑰認證

3 authorsizedkeysfile .ssh/authorized_keys //指定公鑰資料庫檔案

sftp安全ftp

1.在客戶端建立金鑰對

命令:sh-keygen

2.把金鑰對複製的伺服器端

3.在客戶端使用金鑰對驗證

SSH遠端管理配置

在cenos 7系統中,openssh伺服器是由系統盤中的openssh openssh server等軟體包提供的 預設已經安裝 並且已經將sshd新增為標準的系統服務,可以執行systemctl status sshd來檢視服務的狀態。只要擁有合法的登入shell,在不考慮安全限制的情況下,都可...

ssh遠端管理服務

openssh service 提供服務 openssh clients 客戶端 sshd服務的埠號 22 root linux server yum install y openssh 1.伺服器端啟動服務 systemctl start sshd 2.關閉防火牆和selinux遠端登入 root...

SSH遠端管理服務

ssh 安全外殼協議 ssh為secure shell的縮寫,ssh為建立在應用層和傳輸層基礎上的安全協議。採用非對稱加密演算法。用法 ssh root ip位址 ssh埠 ssh埠 22.linux中守護程序 sshd 安裝服務 openssh 服務端主程式 usr sbin sshd 客戶端主程...