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.