If you want to start, stop, restart, enable, reload & check the status of the service follow the below commands to do it. Either root or sudo Authorization required to run the below commands. All the services is available “/etc/init.d/.
1) To Start OpenSSH service
Use the below commands to start the OpenSSH server in Linux.
# For Sysvinit Systems # # service sshd start or # /etc/init.d/sshd start # For Systemd Systems # # systemctl start sshd.service or # systemctl start sshd or # /bin/systemctl start sshd.service
2) To Stop OpenSSH service
Use the below commands to stop the OpenSSH server in Linux.
# For Sysvinit Systems # # service sshd stop or # /etc/init.d/sshd stop # For Systemd Systems # # systemctl stop sshd.service or # systemctl stop sshd or # /bin/systemctl stop sshd.service
3) To Restart OpenSSH service
Use the below commands to restart the OpenSSH server in Linux.
# For Sysvinit Systems # # service sshd restart or # /etc/init.d/sshd restart # For Systemd Systems # # systemctl restart sshd.service or # systemctl restart sshd or # /bin/systemctl restart sshd.service
4) To Reload OpenSSH service
Use the below commands to reload the OpenSSH server in Linux.
# For Sysvinit Systems # # service sshd reload or # /etc/init.d/sshd reload # For Systemd Systems # # systemctl reload sshd.service or # systemctl reload sshd or # /bin/systemctl reload sshd.service
5) To view status of OpenSSH service
Use the below commands to view the status of OpenSSH server in Linux.
# For Sysvinit Systems # # service sshd status or # /etc/init.d/sshd status # For Systemd Systems # # systemctl status sshd.service or # systemctl status sshd or # /bin/systemctl status sshd.service
6) To Enable OpenSSH server in boot
Use the below commands to enable the OpenSSH service in boot.
# For Sysvinit Systems # # chkconfig sshd on # For Systemd Systems # # systemctl enable sshd.service or # systemctl enable sshd or # /bin/systemctl enable sshd.service
That’all to do.You also like to know how to install or update OpenSSH server on Ubuntu,Do check that.
Please Give your opinion below if you experience any issues or to discuss your ideas and experiences.