【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
相关推荐
砚凝霜5 小时前
【软考信息安全】第二十二章 Web服务器安全分析与增强——Apache与IIS
服务器·前端·安全
Android系统攻城狮5 小时前
Linux Gstreamer深度解析之gst_audio_ring_buffer_delay调用流程与实战(七十二)
linux·运维·服务器·gstreamer音视频·音视频进阶
AI砖家5 小时前
安全进入 Agent Loop:2027 年 Coding Agent 的决胜点
数据库·安全·codex·vibecoding
快乐的韭菜根根6 小时前
ubuntu 安装slurm并配置
linux·运维·ubuntu
himobrinehacken6 小时前
取模运算的汇编奥秘揭秘
c语言·安全
墨云安全7 小时前
内网资产无法暴露到公网,怎么做安全检测?2026 年内网渗透测试的落地路径
开发语言·安全·网络安全·渗透测试·php
倒头就睡的小比特7 小时前
Linux基础指令3
linux·服务器
2601_967212728 小时前
安全型电源轨道系统合规选型技术指标与行业技术路线分析
大数据·经验分享·安全
山东科恩光电8 小时前
安全地毯高灵敏感应机制与耐磨材质优势及多场所防护安装维护指南
安全
goehou8 小时前
Prompt 注入实战:直接注入、间接注入和四道防线(附测试样例)
安全·ai·llm·agent·prompt注入