Operating System - HP-UX
1834379 Members
1992 Online
110066 Solutions
New Discussion

how do you shut down ssh on a server

 
SOLVED
Go to solution
pedliz11
Frequent Advisor

how do you shut down ssh on a server

how is the way to shut off ssh on a server and turn it back on again
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: how do you shut down ssh on a server

I assume that you actually mean how to enable/disable thr sshd daemon rather than the ssh client.

/sbin/init.d/sshd stop # stops the daemon
/sbin/init.d/sshd start # restarts it

You can edit /etc/rc.config.d/sshd and set SSHD_START=0 to disable the daemon at boot.
If it ain't broke, I can fix that.
Ivan Krastev
Honored Contributor

Re: how do you shut down ssh on a server

Right commands are:
/sbin/init.d/secsh stop
/sbin/init.d/secsh start

regards,
ivan
A. Clay Stephenson
Acclaimed Contributor

Re: how do you shut down ssh on a server

Ivan is correct; this is one of the oddball cases where the configuration file in /etc/rc.config.d is named differently (sshd) from the script in /sbin/init.d (secsh).
If it ain't broke, I can fix that.
pedliz11
Frequent Advisor

Re: how do you shut down ssh on a server

the reason that i ask is that a paricular application is trying to use tcp port 5001 and 6000 the nmap command shows thse ports as filtered. How do i unfilter them.. Or can I unfilter them?
Ivan Krastev
Honored Contributor

Re: how do you shut down ssh on a server

With nmap you check the remote machine and status filtered can be due to firewall restrictions between 2 nodes.

Check on the server if ports are in use:
#netstat -an

or with lsof.

regards,
ivan
Bill Hassell
Honored Contributor

Re: how do you shut down ssh on a server

By default, ssh uses port 22 unless you have changed it. There are good reasons to change from port 22, especially if your box is connected to the open Internet. However, ssh is an important system network service so I would not recommend setting the port to a high value.

Now it's possible you are seeing these high numbered ports open because the ssh user has logged in and started some application that uses the ports. Get a copy of lsof to display the program(s) that use those ports.


Bill Hassell, sysadmin
pedliz11
Frequent Advisor

Re: how do you shut down ssh on a server

where do i get lsof for hp-ux
Patrick Wallek
Honored Contributor

Re: how do you shut down ssh on a server