CentOS7 Open SSH Service

Source: Internet
Author: User

Recently in the configuration of Open source framework Ceph demo, inside the test connection used to SSH, a moment really did not think up the way to install SSH service, found the following online method, the final success.


Transferred from Http://www.dotblogs.com.tw/michaelchen/archive/2015/01/06/centos_install_ssh.aspx

What to do if there is an accident in the system, but when people are not there?

One way to do this is to use SSH to connect to the system's end machine.

Use the text interface to manipulate

P.s Another method is like the Remote Desktop of Windows (XRDP), which can be operated with a mouse

Let's start the installation.

1. Enter sudo yum install openssh* start installation

2. Enter sudo vi/etc/ssh/sshd_config to set

These settings are some of the more basic

First, get rid of port.

Port 52041

And then the login is limited.

Allowusers user account 1 Users account 2 ....

This line is not available in the setup file ~ Please join in

And take these two lines out of the equation.

Permitemptypasswords No
Passwordauthentication Yes


And then limit the root account login.

Permitrootlogin No

This is roughly the same!



3. Enter sudo systemctl restart Sshd.service re-activate



4. Input sudo systemctl enable sshd.service setting

5. Enter sudo firewall-cmd--permanent--zone=public--add-port=52041/tcp open fire walls

6. Enter sudo firewall-cmd--reload re-read the fire walls rules

The above SSH has been installed setup complete

You can enter netstat-ant to see if the port has been added to the control.

The minimal installation of P.S CentOS 7 did not install Netstat, so if the failure is performed, enter sudo yum install Net-tools

OK then you can use the Putty software to connect to the system.

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.