Enable the SSH service and enable ssh
The SSH service is applicable to all UNIX-like systems, such as Ubuntu, CentOS, and RedHat, including Mac OX. Here we will briefly introduce some of its applicable methods.
First, we will introduce Mac OX. Because SSH is embedded on the Apple system, you don't need to install anything. You just need to set it up:
-> System Preference-> Sharing-> Remote Login (checked ).
Next, let's continue to introduce the installation and use of the Linux SSH service.
SSH is divided into client openssh-client and openssh-server. The system environment I use is Ubuntu14.04.1. The client is installed by default, and no server
If the client is not installed, run the following command to install it:
sudo apt-get install openssh-client
If you need to open the local machine so that users can log on remotely, you must install openssh-server. You can also run the following command to install openssh-server:
sudo apt-get install openssh-server
After the installation is complete, you can run the following command to check whether the SSHServer has been started:
ps -e |grep ssh
If you see sshd, it indicates that the ssh-server has been started.
If it is not started, run the following command:
sudo /etc/init.d/ssh start
Or
service ssh start
Stop Service command:
sudo /etc/init.d/ssh stop
Or
service ssh stop
Then use the following method to log on to SSH:
ssh username@192.168.1.112
If username is 192.168.1.112, enter the password.
Disconnect and enter exit at the terminal.
How does solaris start the ssh service?
You can run the svcadm command as the root user to start the instance or restart the instance if any problem occurs.
First, check the ssh service status:
# Svcs
Or
# Svcs | grep ssh
Online Aug_07 svc:/network/ssh: default
To disable the ssh service (you can view the status of svcs | grep ssh after it is disabled ):
# Svcadm disable svc:/network/ssh: default
# Svcs | grep ssh
(No result is displayed)
Run the following command to start the ssh service:
# Svcadm enable svc:/network/ssh: default
Check the status again. It should be online:
# Svcs | grep ssh
Online 18:13:03 svc:/network/ssh: default
How to enable the ssh service in linux
If SSH is installed (which should be installed by default), enter the following command:
Service sshd restart
Or
/Etc/init. d/sshd