Centos version 7.3mini change ssh default 22 port boot failure problem handling

Source: Internet
Author: User
Tags ssh port


First, Introduction


The default SSH port for CentOS 7.3 Mini system is TCP 22 port, and for security reasons, the default 22 port is often modified for other ports. General city by modifying the/etc/ssh/sshd_config file, the file inside the "#Port 22" changed to "Port 9999", 9999 this port according to their own needs can be freely written. However, if the centos7.3 mini version of the operating system is only modified here, it is not successful, and the modification will directly cause the SSH reboot to fail. This is due to the fact that CentOS has its own selinux, to solve the above situation of the method to see below.


Second, solve the CentOS change default SSH port failure problem


There are two main ways of solving this:

1. Turn off SELinux

2. Install the Semanage tool and add a SELinux port using the Semanage tool.


2.1 Turn off the SELinux method

Check if SELinux is enabled through Getenforce, if the display is disabled the instructions are off, if the display is enforcing the instructions are enabled.

[Email protected] ~]# Getenforce

Disabled


Permanently close SELinux, enter the/etc/selinux/config file, change the selinux=enforcing to selinux=disabled.


2.2 Secure Semanage tool, use the Semanage tool to add a SELinux port.

Security Semanage Tool Method please Baidu, use Semanage to add a selinux port

Semanage port-a-T ssh_port_t-p TCP 9999

Centos version 7.3mini change ssh default 22 port boot failure problem handling

Related Article

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.