【Linux】ssh命令 – 安全的远程连接服务

原创:厦门微思网络

SSH命令的概念

ssh命令的功能是安全地远程连接服务器主机系统,作为OpenSSH套件中的客户端连接工具,ssh命令可以让我们轻松地基于SSH加密协议进行远程主机访问,从而实现对远程服务器的管理工‍作。

语法

复制代码
ssh 参数 域名或IP地址

常用参数

参考示例

基于SSH协议,远程访问服务器主机系统:

复制代码
[root@linuxcool ~]# ssh 192.168.10.10 The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established. ECDSA key fingerprint is SHA256:ZEjdfRjQV8pVVfu0TSYvDP5UvOHuuogMQSDUgLPG3Kc. Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts. root@192.168.10.10's password: 此处输入远程服务器管理员密码 Activate the web console with: systemctl enable --now cockpit.socket 
Last login: Tue Dec 14 08:49:08 2023 [root@linuxprobe ~]#

使用指定的用户身份登录远程服务器主机系统:

复制代码
[root@linuxcool ~]# ssh -l linuxprobe 192.168.10.10 linuxprobe@192.168.10.10's password: 此处输入指定用户的密码 Activate the web console with: systemctl enable --now cockpit.socket [linuxprobe@linuxprobe ~]$

登录远程服务器主机系统后执行一条命令:

复制代码
[root@linuxcool ~]# ssh 192.168.10.10 "free -m" root@192.168.10.10's password: 此处输入远程服务器管理员密码 total used free shared buff/cache available Mem: 1966 1359 76 21 530 407 Swap: 2047 9 2038

强制使用v1版本的SSH加密协议连接远程服务器主机:

复制代码
[root@linuxcool ~]# ssh -1 192.168.10.10
相关推荐
ShirleyWang01210 小时前
DAY01 K3s 私有化部署排障复盘与 SOP
linux·服务器·k8s·k3s·企业部署
AbandonForce11 小时前
Linux进程(WHAT HOW)
linux·运维·服务器
静默追光11 小时前
服务器——看门狗
linux·运维·服务器
无足鸟ICT11 小时前
【RHCA+】测试变量
linux
8K超高清11 小时前
博冠获中国电影电视技术学会科技进步奖
人工智能·科技·算法·安全·接口隔离原则·智能硬件
_abab11 小时前
Rust重塑系统编程:从Linux内核到AI推理引擎的2026全景解析
linux·人工智能·rust
初圣魔门首席弟子11 小时前
TypeScript 类型系统完全指南:从基础到高级工具类型(知识库版)
linux·运维·ubuntu
CQU_JIAKE11 小时前
7.23[a]
linux·运维·服务器
想学好C++的oMen11 小时前
socket编程TCP
linux·网络·网络协议·tcp/ip
ShirleyWang01212 小时前
Linux中Vim编辑器快速找到需要改的行
linux·编辑器·vim