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

What is the future development trend of Business Intelligence BI

Liunx Mysql安装

Centos7安装jdk8以及mysql5.7以及Navicat连接虚拟机mysql的出错以及解决方法(附mysql下载出错解决办法)

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

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

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

Redis cluster data skew

一文讲透,商业智能BI未来发展趋势如何

中国芯片独角兽公司

【NOI模拟赛】给国与时光鸡(构造)
随机推荐
rpiplay实现树莓派AirPlay投屏器
Redis cluster data skew
Using sonar for code checking
A tip to read on Medium for free
String to Base64
DataX User Guide
[force deduction 10 days SQL introduction] Day3
Increase insert speed
关于ETL看这篇文章就够了,三分钟让你明白什么是ETL
利用sonar做代码检查
微博撰写-流程图-序列图-甘特图-mermaid流程图-效果不错
【NOI模拟赛】寄(树形DP)
Base64编码详解及其变种(解决加号在URL变空格问题)
K8S部署高可用postgresql集群 —— 筑梦之路
基于QingCloud的 “房地一体” 云解决方案
IDEA另起一行快捷键
pymysql 向MySQL 插入数据无故报错
216. 组合总和 III-枚举法
Why can ping fail while traceroute can
2020中国全国各省市,三级联动数据,数据机构(数据来自国家统计局官网)