当前位置:网站首页>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 ;
边栏推荐
猜你喜欢

为什么ping不通,而traceroute却可以通

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

疫情、失业,2022,我们高喊着摆烂和躺平!

分布式 | 如何与 DBLE 进行“秘密通话”

ZUCC_ Principles of compiling language and compilation_ Experiment 0607 grammar analysis ll analysis

Send custom events in QT

教程篇(5.0) 08. Fortinet安全架构集成与FortiXDR * FortiEDR * Fortinet 网络安全专家 NSE 5

A tip to read on Medium for free

Pymysql inserts data into MySQL and reports an error for no reason

It is enough to read this article about ETL. Three minutes will let you understand what ETL is
随机推荐
Lombok use
数据中台:中台实践与总结
成为IEEE学生会员
【力扣10天SQL入门】Day2
The pie chart with dimension lines can set various parameter options
Easycvr invokes the interface parameter acquisition method and precautions of device video recording on the page
Distributed | how to make "secret calls" with dble
Picture tools
orb slam build bug: undefined reference to symbol ‘_ ZN5boost6system15system_ categoryEv‘
How to mount a USB hard disk with NTFS file format under RHEL5 system
利用ngrok做内网穿透
微博撰写-流程图-序列图-甘特图-mermaid流程图-效果不错
String转Base64
等保备案是什么意思?应该去哪里办理备案?
IDEA另起一行快捷键
项目部署相关
Building a static website with eleventy
数据中台:数据中台全栈技术架构解析,附带行业解决方案
GradScaler MaxClipGradScaler
Pymysql inserts data into MySQL and reports an error for no reason