【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
相关推荐
你的人类朋友29 分钟前
什么是OpenSSL
后端·安全·程序员
支付宝体验科技6 小时前
AI4SDL:支付宝业务应用研发安全保障体系建设实践
安全
没逻辑11 小时前
Post-Quantum HTTPS:未来的安全通信架构
后端·安全
LH_R13 小时前
OneTerm开源堡垒机实战(四):访问授权与安全管控
运维·后端·安全
用户311879455921813 小时前
Kylin Linux 10 安装 glib2-devel-2.62.5-7.ky10.x86_64.rpm 方法(附安装包)
linux
涛啊涛14 小时前
Centos7非LVM根分区容量不足后扩容,对调硬盘挂载/
linux·磁盘管理
CYRUS_STUDIO1 天前
用 Frida 控制 Android 线程:kill 命令、挂起与恢复全解析
android·linux·逆向
熊猫李1 天前
rootfs-根文件系统详解
linux
LH_R2 天前
OneTerm开源堡垒机实战(三):功能扩展与效率提升
运维·后端·安全
dessler2 天前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs