Linux_开放端口

cd /root/.ssh
上传id_rsa.pub 到 /root/.ssh

授权密钥:
chmod 600 /root/.ssh/authorized_keys
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
安装启动防火墙:
yum -y install firewalld
systemctl start firewalld
systemctl enable firewalld

#修改ssh配置:修改默认ssh端口、开启秘钥登录、、禁止密码登录、开启闲置超时
sed -i “s/^#Port./Port 1557/g" /etc/ssh/sshd_config
sed -i "s/^#RSAAuthentication.
/RSAAuthentication yes/g” /etc/ssh/sshd_config
sed -i “s/^#PubkeyAuthentication./PubkeyAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/^PasswordAuthentication.
/PasswordAuthentication no/g” /etc/ssh/sshd_config

重启ssh服务:
systemctl restart sshd
显示所有公共端口:
firewall-cmd --zone=public --list-ports
开放端口:
firewall-cmd --permanent --add-port=1557/tcp
firewall-cmd --permanent --add-port=25/tcp
firewall-cmd --permanent --add-port=80/tcp

查询本机当前开放端口:
netstat -ntpl

5、sz和rz 命令安装口
执行:yum install lrzsz
等待安装完毕,然后一直输入Y即可
linux默认版本是无法使用 sz和rz 命令的,会提示:waiting to receive.**B0100000023be50
这个时候,换个工具连接Linux即可(如Xshell)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值