ID #1202

How can I restart OpenSSH when I'm logged in via SSH?

Problem: when you're logged in from remote via OpenSSH and you want to restart the OpenSSH server process (i.e. you've made changes to the sshd_config file), you cannot simply use:

rc_opensshd restart

because this will kill the SSH session and the OpenSSH server is stopped, but not started because of this.

Solution: the solution is to use the 'fork' command so the restart will take place in background and you will be able to login within seconds after loosing the connection:

fork rc_opensshd restart

Last update: 2005-06-03 14:34
Author: dingetje
Revision: 1.0

Print this record Print this record
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
Export as XML-File Export as XML-File

Please rate this entry:

Average rating: 5 from 5 (1 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry