【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
相关推荐
倔强的石头1062 小时前
openGauss数据库:从CentOS 7.9部署到实战验证
linux·数据库·centos
梁正雄3 小时前
linux服务-Nginx+Tomcat+Redis之Session 共享 - 容器单机版
linux·nginx·tomcat
linchare6 小时前
linux debian上只装mysql的客户端步骤
linux·mysql·debian
百***75748 小时前
linux上redis升级
linux·运维·redis
半个西瓜.8 小时前
车联网NFC测试:NFC信号嗅探测试.
网络·安全·网络安全·车载系统
顾安r8 小时前
11.22 脚本打包APP 排错指南
linux·服务器·开发语言·前端·flask
Neur0toxin8 小时前
入侵排查_2025/11/23
linux·windows·应急响应
小小编程能手9 小时前
Linux文件编程
linux·运维·服务器
t***D2649 小时前
MySQL安全
数据库·mysql·安全
木童6629 小时前
nginx安装步骤详解
linux·运维·服务器·网络·nginx