Centos 7 Novice on the road

Source: Internet
Author: User
Tags ssh port

First, Centos 7 modify SSH port number

1, modify the/etc/ssh/sshd_config

Vi/etc/ssh/sshd_config

#Port 22 Add the following line under this line

Port 7156//Add this line below


2. Modifying SELinux

Use the following command to view the SSH ports currently allowed by SELinux:

Install Semanage,

Yum-y Install Policycoreutils-python

Semanage port-a-t ssh_port_t-p TCP 7156


And then make sure you add it in.

Semanage Port-l | grep ssh

If successful will output

ssh_port_t TCP 7156, 22


3. Restart SSH

Systemctl Restart sshd (systemctl restart Sshd.service)


4. Firewall Open SSH port

Firewall-cmd--zone=public--add-port=7156/tcp--permanent

Firewall-cmd--reload

Firewall-cmd--list-all-zones |grep 7156//View Results


Second, no ifconfig command, use Yum Search ifconfig query Package

Yum-y Install Net-tools


Third, hostname Save the Directory

/etc/hostname


Centos 7 Novice on the road

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.