Linux modifies the default port for FTP, Telnet, ssh

Source: Internet
Author: User
Tags ftp ssh port number ssh port

First, modify the SSH default port

1, edit the SSH configuration file:

#vi/etc/ssh/ssh_config
#vi/etc/ssh/sshd_config
The above 2 files, all remove the #port22 before "#", change 22 to a custom port, such as 2222
#vi/etc/service the SSH-related port to 2222
#service sshd Restart

Linux under the default SSH port is 22, for security reasons, now modify the SSH port is 1433, modify the following method

/usr/sbin/sshd-p 2222 +ip Address

2. Edit Telnet configuration file
#vi/etc/xinetd.d/ekrb5-telnet
Change Disable=no to Disable=yes
#vi/etc/service to change the Telnet-related port to a custom, such as 2323
#service xinetd Restart


<!--[If!supportlinebreaknewline]-->

3. Edit VSFTPD configuration file:

#/etc/vsftpd.conf

Add one of the following statements to this file:

listen_port=8021

Service VSFTPD Restart


<!--[endif]-->

Target: The default port is 21, and for system security, 21 ports need to be modified to 2021.

Steps: 1. Modify the/etc/services file (default assigned port number and protocol type)

# vi/etc/services

Modify the 21/tcp to 2021/tcp

2. Modify (Add) FTP configuration file vsftpd.conf

# vi/etc/vsftpd/vsftpd.conf

If there are listen_port=21 in the file, the 21 is modified to 2021,

Otherwise add a row listen_port=2021

3. Start TFP Service

# Service VSFTPD Restart

4. Check the TFP service

# Service VSFTPD Status

Or

# NETSTAT-NPL

To start an error resolution:

Common error: VSFTPD is dead, but Subsys is locked

Solution:

1. A, RPM--verify vsftpd
B, Service vsftpd stop
C, Service vsftpd start

2. Carefully check the vsftpd.conf configuration, keep trying, the problem is still unresolved, compared to the normal FTP server, the configuration file is no different, to determine that this file is not a problem. View/etc/xinetd.d/gssftp, modify disable to Yes. Then restart Xinetd and VSFTPD, as follows:

# Service XINETD Restart

Stop xinetd:[OK]

Start xinetd:[OK]

#service vsftpd Stop

Shutdown vsftpd:[failed]

#service vsftpd Status

VSFTPD is dead, but Subsys is locked.

Feel the problem still unresolved, at this time client FTP is still available, so try to stop Xinetd:service xinetd stop at this time, client FTP is not available, and then restart the VSFTPD:

# Service VSFTPD Stop

Close vsftpd:[OK]

# service VSFTPD Start

Start vsftpd:[OK for VSFTPD]

Successful, client FTP can be used again.

After modifying Gssftp, execute xinetd restart,vsftpd still error, execute xinetd stop first, then restart VSFTPD, then start xinetd that success

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.