≡ Menu

CentOS Linux: Start / Stop / Restart SSHD Command

I‘m a new CentOS Linux server user. How can I start, stop, or restart the OpenSSH (SSHD) server on a CentOS Linux? How can I start SSHD on boot time on a CentOS Linux?

You need to use the following two commands:

  1. service command – Stop, start, restart or find the status of system services.
  2. chkconfig command – Turn on or off services on boot time.

sshd service name a CentOS Linux

The name of the service is also sshd and usually controlled by /etc/init.d/sshd script or service command.

CentOS turn on OpenSSH SSHD server on boot time command

The syntax is as follows to turn on SSHD on boot time:

# chkconfig sshd on

To turn off service on boot time, enter:

# chkconfig sshd off

To see the current status of service in each run-level type:

# chkconfig --list sshd

Sample outputs:

sshd           	0:off	1:off	2:on	3:on	4:on	5:on	6:off

CentOS start sshd service command

The syntax is:

# service sshd start

OR

# /etc/init.d/sshd start

CentOS stop sshd service command

The syntax is:

Alert: Do not run the following command over ssh based session and you will end up getting ‘network connectivity lost’ error.

# service sshd stop

OR

# /etc/init.d/sshd stop

CentOS restart sshd service command

The syntax is:

# service sshd restart

OR

# /etc/init.d/sshd restart

CentOS find status of the sshd service command

The syntax is:

# service sshd status

OR

# /etc/init.d/sshd status

Sample session outputs from the above commands

Fig. 01: service and chkconfig command in action

Fig. 01: service and chkconfig command in action

Share this tutorial on:
{ 1 comment… add one }
  • aref ghobadi August 17, 2015, 10:08 am

    Hi
    systemctl start httpd
    systemctl stop httpd
    systemctl restart httpd ===> service down and up
    systemctl reload httpd ===> service not down only reading the configuration file service
    reload vs restart :

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , ,