Link to home
Start Free TrialLog in
Avatar of beer9
beer9Flag for India

asked on

How sshd restart works when I ssh to a box and restart sshd?

I sshed to a box and executed following command, I didn't loose my sshd connectivity and was able to successfully restart the service. How was I able to do it? What happened beneath?
sudo /etc/init.d/sshd restart
Password:
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of inf_6
inf_6
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of beer9

ASKER

So what would happen if I execute below command while I am still sshed to the host, would I still have remote login connectivity?

sudo /etc/init.d/sshd stop
If you run "/etc/init.d/sshd stop", you will not disconnect from the machine. Your active session will be running until you disconnect by yourself.
All new connections will be disabled.
You can check the tree of running sshd daemons with

ps axf
Avatar of beer9

ASKER

Thank you! :-)