New to Centos 7

Source: Internet
Author: User

New to Centos 7

1. Modify the SSH port number in Centos 7

1. Modify/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. Modify SELinux

Run the following command to view the ssh ports allowed by SElinux:

Install semanage,

Yum-y installpolicycoreutils-python

Semanage port-a-t ssh_port_t-p tcp 7156

Then confirm whether to add it.

Semanage port-l | grep ssh

If it is successful

Ssh_port_t tcp 7156, 22

3. Restart ssh

Systemctl restart sshd (systemctl restart sshd. service)

4. Open the ssh port in firewall

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

Firewall-cmd -- reload

Firewall-cmd -- list-all-zones | grep 7156 // view the result

2. No ifconfig command. You can use yum search ifconfig to query the package.

Yum-y install net-tools

Iii. hostname storage directory

/Etc/hostname

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.