ssh 连接失败 sz rz 安装

本文介绍如何在Linux环境下安装sz和rz文件传输命令,同时提供了检查和配置SSH服务的方法,包括服务状态检查、防火墙设置以及SSH服务的重启步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

sz 下载命令, rz上传命令的安装

sudo apt-get install lrzsz

 

 

1. 检查sshd服务的状态以及端口是否正常, 如下为正常状态

sudo netstat -nlp | grep :22

henry@henry-Latitude-D430:~$ netstat -nlp | grep 22
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -              
tcp6       0      0 :::22                   :::*                    LISTEN      -        

 

如果没有,则先重启ssh服务, 如果没有装ssh服务,则sudo apt-get install ssh

/etc/init.d/sshd restart       

 

2. 检查防火墙是否开启

查看防火墙状态

henry@henry-Latitude-D430:~$ sudo ufw status
Status: active

偿试关闭防火墙

henry@henry-Latitude-D430:~$ sudo ufw disable
Firewall stopped and disabled on system startup
henry@henry-Latitude-D430:~$ sudo ufw status
Status: inactive

开启防火墙命令:

henry@henry-Latitude-D430:~$ sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup

henry@henry-Latitude-D430:~$ sudo ufw status
Status: active

 

转载于:https://www.cnblogs.com/henryliublog/p/9900273.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值