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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH problem

Status
Not open for further replies.

sanmi

MIS
Oct 20, 2006
35
US
I'm trying to insatll open SSH on allmy servers, but I can't seem to get past the 1st one.
I installed OPENssh, Openssl, libgcc, zlib, tcp_wrappers & the recommended patch 112438-03.

I unpacked & added all the pkgs. I insatlled the ssh script as one of the instructions indicated. I also copied the /usr/local/etc/ssh_config & /usr/local/etc/sshd_config to /etc/ssh/ssh_config & etc/ssh/sshd_conig & uncomment what should be allowed.

When I ran # ./S98sshd start - I got he following error message :
There are one or more sshd instances
running, please stop them manually.

When I did ps -ef | grep sshd, nothing came up.

I have private shell on my nt workstation & I tried to connect to this server using SSH, I got this message :
Could not establisg tcp connection ...

Even though I had already added this to the /etc/service as well as /etc/inetd.conf file.

I need some to please help me through this configuration as I'm sinking & can't swim out.

Thanks.
sanmi
 
I'm not sure that I know what you mean by rpm...

I think I downloaded it from sourch (Freeware for Solaris)

Thanks,
Sanmi
 
Did you get it from sunfreeware.com? I'm guessing you did. (I'd recommend it, if you didn't.)

What if you type: /usr/local/bin/sshd ?(assuming that's where sshd is located).

-Tim
 
Does netstat -an | grep [.]22 show anything listening on port 22 already?

Check the S98sshd script to see if it looks for any /var/run/sshd.pid files or something which may already exist.

Annihilannic.
 
sshd is in /usr/local/sbin/sshd


I manually created /var/run/sshd.pid b/c when I first ran the script, I got an error message indicating no such file or directory - /var/run/sshd.pid

Here's the cript I ran ..


# more sshd
#!/bin/sh
#
# OpenSSH startup script
#
# Tested on Solaris 8
#

sshconf=/usr/local/etc/sshd_config

[ -f /usr/local/sbin/sshd ] || exit 0

# See how we were called.

case "$1" in
start)
# Start daemons.
# check if sshd is running [1] or not [0]
#num=`ps -elf|grep /usr/local/sbin/sshd |grep root|grep -v
# grep|wc -l|cut -c 8`
#if [ "$num" = "0" ] ;
if [ -r /var/run/sshd.pid ] ; then
echo "There are one or more sshd instances
running, please stop them manually";
else
echo "Starting sshd using $sshconf "
/usr/local/sbin/sshd -f $sshconf
echo "forked at Pid `cat /var/run/sshd.pid`"
echo "done." ;
fi
;;
stop)
# Stop daemons.
# checking if there is pid available
[ -f /var/run/sshd.pid ] || exit 0

echo "Shutting down sshd..."
kill `cat /var/run/sshd.pid`
echo "done."
;;
restart)
$0 stop
$0 start
;;
status)
if [ -r /var/run/sshd.pid ] ; then
echo "Ssh is currently forked at Pid `cat
/var/run/sshd.pid` and ready to serve requests"
else
echo "SSH server is not running!" ;
fi
;;
*)
echo "Usage: sshd {start|stop|restart|status}"
exit 1
esac

exit 0
# EOF
#
#

Thanks Again
sanmi
 
Remove the sshd.pid file, all you needed to do was create the /var/run directory.

Annihilannic.
 
Thank you...I removed it
# rm sshd.pid


I then re ran the script & I got the following message

# cd /etc/rc2.d
# ./S98sshd start
Starting sshd using /usr/local/etc/sshd_config
ld.so.1: sshd: fatal: libc.so.1: version `SUNW_1.22' not found (required by file /usr/local/sbin/ssh
d)
ld.so.1: sshd: fatal: libc.so.1: open failed: No such file or directory
Killed
cat: cannot open /var/run/sshd.pid
forked at Pid
done.
 
Looks like you have downloaded the wrong version of SSH for your OS. Please answer spamly's questions from his post above...

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top