Here is the whole scenario:
- installed ssh apt-get install ssh
- created a new user (I know I didn't have to)
- logged into the system via ssh using the new user
- modified the /etc/ssh/sshd_config to allow root login
- issued the command systemctl status ssh
- it showed that service was running
- issued systemctl stop ssh (I know I could have used service cmd)
- I was still logged in via ssh! not sure how that works
- opened a new putty instance and tried to connect and it said service not accessible/timed out
- issued systemctl start ssh and tried logging in as user with new putty instance and it worked
I was wondering why it didn't tear down the first instance (new user log-in via ssh)? was it because when I initially logged in, the ssh accepted the connection on port 22 and opened a new web socket port (multi-thread) and assigned my connection to that port and was listening to another connection on port 22 and when I logged in after stopping the service it said timed out?
I'm sure ssh doesn't keep track of the random port it opens, would you say it could possibly be a bug (not broken). Shouldn't the c program also keep track on ssh and also take down instances when ssh service has been stopped. any thoughts?
systemctland notserviceif you're using a distro withsystemd. If you use theservicecommand on asystemddistro it just callssystemctland warns you:service httpd status: Redirecting to /bin/systemctl status httpd.service