当前位置:网站首页>Change SSH port number
Change SSH port number
2022-06-24 08:46:00 【Gegwu MMQ!!】
The first one is :
01 If you want to change SSH Default port for (22), Then you just have to modify :/etc/ssh/sshd_config in Port 22, Here is the 22 Just change to the port you want to set , But don't set the same port as the existing one , In case of unknown consequences .
02 If you want to limit SSH Landed IP, Then you can do the following :
First : modify /etc/hosts.deny, Add to it sshd:ALL
then : modify :/etc/hosts.allow, Make the following settings :sshd:192.168.0.241
In this way, only 192.168.0.241 Of IP adopt SSH Landing LINUX It's a machine . Of course, as a server , I don't pretend gnome and KDE Of , And many don't pretend , This increases the safety factor .
The second kind :
First, modify the configuration file
vi /etc/ssh/sshd_config
find #Port 22 a section , Here is the default use of the logo 22 port , It is amended as follows :
Port 22
Port 50000
Then save to exit
perform /etc/init.d/sshd restart
such SSH The port will work simultaneously with 22 and 50000 On .
Now edit the firewall configuration :vi /etc/sysconfig/iptables
Enable 50000 port .
perform /etc/init.d/iptables restart
Now please use ssh Tool connection 50000 port , To test for success . If the connection is successful , Edit again sshd_config Set up , Will be inside Port22 Delete , that will do .
The reason for setting it to two ports first , Close another port after the test is successful , Is to modify the way conf In the process of , In case of a drop 、 Broken net 、 Misoperation and other unknown situations , It can also be connected and debugged through another port so as to avoid failure of connection. It is necessary to send someone to the machine room , Make the problem more complicated .
The operation steps are as follows :
Need to close early selinux;
1、 Get into /etc/vsftpd Catalog , modify vsftpd.conf The configuration file
change listen_port=21 by listen_port=801
2、 edit /etc/services file , find ftp The corresponding line
ftp 21/tcp
ftp 21/udp
Change it to
ftp 801/tcp
ftp 801/udp
3、 When the changes are complete , restart vsftpd service
/etc/init.d/vsftpd restart
4、 Add a rule to the firewall ,tcp Of 801 Port access allowed
-A INPUT -p tcp -m tcp --dport 801 -j ACCEPT
5、netstat -nltp |grep vsftp Check whether the port listening is 801
6、windows Local client access
ftp://192.168.4.100:801/
enter one user name 、 Password access ;
Or by FileZilla Client software login ;
边栏推荐
- There was an error checking the latest version of pip
- 一文详解|增长那些事儿
- 基于QingCloud的地理信息企业研发云解决方案
- 原生小程序用画布制作海报,等比例缩放,和uniapp差不多就是写法有点不同
- Use cpulimit to free up your CPU
- Smart power plant: how to make use of easycvr to build a safe, stable, green and environment-friendly intelligent inspection platform
- Easycvr invokes the interface parameter acquisition method and precautions of device video recording on the page
- OpenCV每日函数 结构分析和形状描述符(7) 寻找多边形(轮廓)/旋转矩形交集
- Earthly container image construction tool -- the road to dream
- lombok 使用
猜你喜欢

关于ETL看这篇文章就够了,三分钟让你明白什么是ETL

關於ETL看這篇文章就够了,三分鐘讓你明白什麼是ETL

opencv最大值滤波(不局限于图像)

The form image uploaded in chorme cannot view the binary image information of the request body
![Jenkins is deployed automatically and cannot connect to the dependent service [solved]](/img/fe/f294955a9bdf7492aab360e44e052d.png)
Jenkins is deployed automatically and cannot connect to the dependent service [solved]

2022.06.23(LC_144,94,145_二叉树的前序、中序、后序遍历)

Liunx Mysql安装

数据库迁移从PostgreSQL迁移到 MYSQL

基于QingCloud的 “房地一体” 云解决方案

Qt 中发送自定义事件
随机推荐
input的聚焦后的边框问题
利用sonar做代码检查
Use cpulimit to free up your CPU
打印出来的对象是[object object],解决方法
leetcode 1268. Search suggestions system
"Adobe international certification" Photoshop software, about drawing tutorial?
小程序wx.show
不能改变虚拟机电源状态报错解决方案
IDEA另起一行快捷键
数据中台:民生银行的数据中台实践方案
There was an error checking the latest version of pip
2021-05-20computed和watch应用与区别
Shell array
数据中台:数据采集和抽取的技术栈详解
数据中台:国内大厂中台建设架构集锦
liunx 更改 vsftpd 的端口号
2022.06.23(LC_144,94,145_二叉树的前序、中序、后序遍历)
liunx服务器 telnet 带用户名 端口登陆方法
Easynvr and easyrtc platforms use go language to manage projects. Summary of the use of govendor and gomod
It is enough to read this article about ETL. Three minutes will let you understand what ETL is