Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop SSHD process from running???

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
How to i stop the SSHD from running. I try /use/sbin/sshd stop and i get an error saying that there is an extra arguement.

The reason i want to do this is because why have it running if no one is suppossed to be ssh-ing into the server.

I dont want to remove ssh, i just want to have the ability to stop and start it.

Thanks as always



Adam
 
pidof sshd | xargs kill -kill
or ps -aux | grep sshd | awk ' {print $2} ' | xargs kill -kill 2 > /dev/null

This will not address the problem of having it start
when called from the sshd rc.script by init.
Depending on your distribution there should be a systems
managment tool to turn ssh off.
Yast,chkconfig, etc...

If not /etc/rc.d (or wherever your distro keeps the rc
scripts) should contain all the rc symlinks to the rc
scripts for each runlevel. Just remove all symlinks
pointing to ssh (S18sshd K12sshd: example).

Good Luck
 
Hi,

On redhat and mandrake you can disable it from starting automatically by doing (as root) :

/sbin/chkconfig --level 2345 sshd off

To start / stop, etc., manually just do:

/etc/rc.d/init.d/sshd start
/etc/rc.d/init.d/sshd stop
/etc/rc.d/init.d/sshd restart (stop and start)
/etc/rc.d/init.d/sshd reload

As marsd says, if you are using another distro it could be somewhat different.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top