【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
相关推荐
其实防守也摸鱼16 分钟前
每天一个知识点——RCE漏洞
运维·服务器·数据库·windows·安全·github·漏洞
ao-weilai1 小时前
Linux网络编程:网络知识基础
linux·网络·php
GeW1 小时前
RHCE10一次过!提高通过率+快速拿证的7个核心技巧
linux
天涯浪客1 小时前
LLM 做 SAST 误报研判:四层防护让结果不飘
安全
浅念-1 小时前
C++ Protobuf 入门实战:基于通讯录项目吃透proto3语法与序列化
linux·服务器·网络·c++·protobuf·proto·proto3
不怕犯错,就怕不做2 小时前
RK linux在buildroot中如何添加linux命令
linux·驱动开发·嵌入式硬件
小羊在睡觉2 小时前
HLS视频
linux·后端·golang
宵时待雨2 小时前
linux笔记归纳18:传输层协议TCP
linux·网络·笔记·网络协议·tcp/ip
苏打水com2 小时前
内容合规红线:大模型生成内容,哪些能做哪些会犯法?
人工智能·安全·大模型
吴声子夜歌2 小时前
Shell编程——条件测试与比较
linux·运维·shell