SSH 為 Secure Shell 的縮寫。
SSH 是建立在應用層基礎之上,專為遠程登錄會話和其它網絡服務提供的可靠安全協議。
ssh root@47.99.XX.XX
基本語法
ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] [user@]hostname [command]
選項參數
| 參數 | EN 解釋 | 中文翻譯 | 備注 |
|---|---|---|---|
| 功能 | 命令 | 文字解釋 | 示例 | 示例解釋 |
|---|---|---|---|---|
| 登陸 | ssh username@<固定公網IP或EIP> | 遠程登陸 username | ssh root@47.99.XX.XX | 鍵入口令遠程登陸 root |
| ssh username@192.168.1.112:22 | 遠程登陸 username | |||
| ssh://username:******@192.168.1.112:22 | 遠程登陸 username (* 錶示口令) | |||
| 幫助 | ssh --help | 展示幫助信息 |
安裝 apt-get install openssh-server 版本 dpkg -l openssh-server 進程 ps -e | grep ssh
停止 /etc/init.d/ssh stop 重載 systemctl reload sshd 或 rcctl reload sshd systemctl restart sshd 啓動 /etc/init.d/ssh start 或 service ssh start 重啓 /etc/init.d/ssh restart 或 service sshd restart
SSH 服務器配置
日誌 vi /var/log/auth.log 配置 vi /etc/ssh/sshd_config
SSH 服務器默認端口 22,可自定義成其它端口號,如:222
received:3,expected:20 錯誤
Xshell 5 以 SSH 協議連接 Ubuntu 20.04 (或麒麟 Kylin V10) 提示以上錯誤, 解決方法:
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
在 /etc/ssh/sshd_config 文件末尾,添加以上行, 然後重啓 openssh 服務器
systemctl reload sshd 或 rcctl reload sshd systemctl restart sshd
版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。