Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
cancel
Showing results for 
Search instead for 
Did you mean: 

sshd reread

SOLVED
Go to solution
himacs
Super Advisor

sshd reread


Hi gurus,

how to reread sshd process.Actually i dont want to stop the sshd by using /sbin/init.d/secsh start/stop.

If i use below command, any problem to existing ssh connections.

kill -SIGHUP `cat /var/run/sshd.pid`


please help on this...bit urgent


regards,
himacs
9 REPLIES
Steven E. Protter
Exalted Contributor

Re: sshd reread

Shalom,

The only way to do this is a start/stop

If its fast, existing connections will stay online and be serviced.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TTr
Honored Contributor

Re: sshd reread

kevin_m
Valued Contributor
Solution

Re: sshd reread

I've done a 'kill -HUP ' several times and never lost connectivity, at least for the SSH session used to run the kill command.
- Kevin
Mel Burslan
Honored Contributor

Re: sshd reread

/sbin/init.d/secsh stop
/sbin/init.d/secsh start

anything else is a crapshoot at best
________________________________
UNIX because I majored in cryptology...
Steven Schweda
Honored Contributor

Re: sshd reread

> anything else is a crapshoot at best

Yeah. I'm sure that all that junk in the
manual like:

[...] sshd rereads its configuration
file when it receives a hangup signal,
SIGHUP, by executing itself with the
name and options it was started with,
e.g. /usr/sbin/sshd. [...]

was put there to lead the gamblers astray.


http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8
Mel Burslan
Honored Contributor

Re: sshd reread

Books sometimes differ from the real life. Unfortunately inetd and sshd are the two products that I do not have confidence about re-reading the configuration file when received a SIGHUP signal, from my personal experience. You might chose to go by the book. That is a preference. Keeping the sshd down for a second or two does not mean a catastrophe on my end, so, I'll do how I chose to believe and Stephen, you do as you please.
________________________________
UNIX because I majored in cryptology...
Steven Schweda
Honored Contributor

Re: sshd reread

> [...] I do not have confidence [...] from
> my personal experience.

And I have more confidence in my experience
than I have in yours.

> [...] you do as you please.

Thanks for your permission, Mr. Burlap.
himacs
Super Advisor

Re: sshd reread

Ha admin,

thanks for ur replies

i have used kill -SIGHUP `cat /var/run/sshd.pid` to reread. /var/run/sshd.pid file contains process id of parent ssh process.
it rereads sshd,so existing connections (child)
remains not killed.


regards

himacs
Mel Burslan
Honored Contributor

Re: sshd reread

Even if you kill the sshd daemon, listening to port 22 on your system, it will not kill all the running ssh sessions. As long as it is down, your server can not accept any newly incoming connections. In my case this is about 2 to 3 seconds. Just wanted to let you know so that you do not have any misconceptions.
________________________________
UNIX because I majored in cryptology...