linux check if ssh is enabled?
1 Installation
apt-get install openssh-server
2 After completion, check whether the ssh server is started:
ps -e | grep ssh
If only:
ssh-agent
It means the server is not started
You can start it manually:
sudo /etc/init.d/ssh start
or restart ubuntu
Recommended: "Linux Tutorial"
3 Now you can use putty to connect
rpm -qa | grep ssh You can see the ssh installation package in the system
rpm -ql openssh-3.5p1-6 View the installation information of the installation package ( Such as installation path, configuration file, etc.)
ps -e | grep ssh Check whether the ssh service is running. If so, you can see something similar to the following:
2254 ? 00:00:00 sshd
This proves that ssh is already running Now, the process name is sshd
If it is not running, you can run it through the following command:
root]#/etc/rc.d/init.d/sshd start root]#service ssh start
Look at the network connection of this ssh service:
root]#netstat -ntlp
If you look Go to the following content:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 22109/sshd
This shows that sshd can work normally. If the client (SecurCRT, putty, etc.) cannot be connected, try turning off the firewall
Try: service iptables stop
The above is the detailed content of Check if ssh is enabled in linux. For more information, please follow other related articles on the PHP Chinese website!