linux 远程管理ssh sz/rz

23 篇文章 0 订阅

sentos7 连接配置

安装sentos7

自行安装sentos7 建议使用virtualBox创建

服务端安装openssh-server

# 检查是否已经安装openssh-server
[vagrant@localhost ~]$ yum list installed|grep openssh
openssh.x86_64                       7.4p1-21.el7              @base
openssh-clients.x86_64               7.4p1-21.el7              @base
openssh-server.x86_64

如果不存在需要安装

[vagrant@localhost ~]$ sudo yum install openssh-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.cn99.com
Package openssh-server-7.4p1-21.el7.x86_64 already installed and latest version
Nothing to do
# 提示已经安装了,啥也不干

配置sshd_config

修改配置文件
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes

[vagrant@localhost ~]$ cd /etc/ssh
[vagrant@localhost ssh]$ ll
total 604
-rw-r--r--. 1 root root     581843 Aug  9  2019 moduli
-rw-r--r--. 1 root root       2276 Aug  9  2019 ssh_config
-rw-------. 1 root root       3916 Jul 14 15:45 sshd_config
[vagrant@localhost ssh]$ vi  ssh_config
# 自行打开配置即可

开启服务

[vagrant@localhost ssh]$  sudo service sshd start

netstat -an | grep 22 检查 22 号端口是否开启监听

[vagrant@localhost ssh]$ netstat -an|grep 22
-bash: netstat: command not found

此时需要安装网络工具

sudo yum install -y net-tools

重新检查22端口

[vagrant@localhost ssh]$ netstat -an | grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 10.0.2.15:38772         183.60.138.229:80       TIME_WAIT
tcp        0      0 10.0.2.15:22            10.0.2.2:53359          ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN

设置开机重启
systemctl enable sshd.service

szrz安装

  • sz :将linux系统文件发送到windows系统
  • rz :上传windows文件到linux系统

查看rz在哪个软件包下
yum provides rz

[root@localhost ~]# yum provides rz
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
lrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programs
Repo        : base
Matched from:
Filename    : /usr/bin/rz



lrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programs
Repo        : @base
Matched from:
Filename    : /usr/bin/rz

返回
lrzsz-0.12.20-36.el7.x86_64

yum -y install lrzsz

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值