hrist
1
Hi
where can i find the ssh service on solaris 8 if "sshd" it is not available on /etc/init.d?
i want to restart the service.
i did a "which" and i found this. is this the right path? i want to double check since this is a prod server.
bash-2.03# which sshd
/usr/sbin/sshd
Thanks
Hope this command will work
kill -HUP `cat /var/run/sshd.pid`
usually HUP signal is used to restart the process.
You must be a root user for performing this operations.
Please try this too if the above command is not working
/etc/init.d/sshd stop
/etc/init.d/sshd start
Use whereis command instead which.
hrist
3
^ thanks for your reply.
sshd is not available on the /etc/init.d/ so i cannot execute ./sshd stop| start
As a follow up question, do you know how can i setup the sshd on /etc/init.d/? can i symlink it or something?
Thanks again.
ccj4467
4
This is my sshd script from a Solaris 8 machine
#!/bin/sh
# Determine the process ids of the daemons and no other processes
pids=`/bin/ps -ef | \
/bin/grep sshd | \
/bin/egrep -v "grep|$$|start|stop" | \
/bin/awk '{printf "%d ", $2}'`
case $1 in
'start')
if [ "$pids" = '' ] ; then
/usr/local/sbin/sshd
else
echo '' 1>&2
echo 'WARNING: /etc/init.d/sshd already running' 1>&2
echo '' 1>&2
fi
;;
'reconfigure')
if [ "$pids" != '' ] ; then
if [ -f /var/run/sshd.pid ] ; then
/bin/kill -1 `/bin/cat /var/run/sshd.pid`
elif [ -f /usr/local/etc/sshd.pid ] ; then
/bin/kill -1 `/bin/cat /usr/local/etc/sshd.pid`
else
echo '' 1>&2
echo 'ERROR: missing sshd pid file' 1>&2
echo '' 1>&2
fi
else
echo '' 1>&2
echo 'ERROR: sshd is not running' 1>&2
echo '' 1>&2
fi
;;
'stop')
if [ "$pids" != '' ] ; then
/bin/kill $pids
fi
;;
*)
echo '' 1>&2
echo 'usage: /etc/init.d/sshd {start|reconfigure|stop}' 1>&2
echo '' 1>&2
;;
esac
You will have to modify the paths to the sshd executable.
There is possibility of ssh startup script in the rc3.d directory or somewhere there.
Do a find
find / -name *ssh* -print