LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2003, 01:46 PM   #1
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
sshd dead but subsys locked


I'm on Red Hat 9.
I click on System Settings/Server Settings/Services.
I go down the list to sshd.
It is checked.
Description is OpenSSH server daemon.
Status says: sshd dead but subsys locked

If I click on start I get a little dialog that says: sshd start successful
If I click on restart I get a little dialog that says: sshd restart successful
If I click on stop I get: sshd failed. The error was: Stopping sshd:[FAILED]
The status line remains at: sshd dead but subsys locked

I want to ssh into the machine from a remote system.

Any ideas on the problem with "sshd dead but subsys locked"?

There is a subsystem line in /etc/ssh/sshd_config:
Subsystem sftp /usr/libexec/openssh/sftp-server
The permissions on sftp-server is set at 755.

Thanks...
 
Old 12-18-2003, 02:22 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607
Patience... a wee bit patience...
Did it run properly before/when did this behaviour start?
Is it configured properly?
Are there any errors in the logs?
And if you start it manually and supply the debug parameter?
 
Old 12-18-2003, 03:44 PM   #3
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
I just started trying to use it.
Well, I was working on the configuration file and needed to start the daemon to test it, that's where I discovered the sshd dead thing.

I grep'ed /var/log/messages and this was in there:
Dec 18 12:54:12 ssglinux sshd: succeeded
Dec 18 12:54:17 ssglinux sshd: sshd shutdown failed
Dec 18 12:54:17 ssglinux sshd: succeeded

No occurrences of ssh in dmesg.

I'm not sure how to start it manually:
[root@linux root]# cd /usr/sbin
[root@linux sbin]# ./sshd restart
Extra argument restart.
[root@linux sbin]# ./sshd start
Extra argument start.
[root@linux sbin]# ./sshd
[root@linux sbin]# ps -A | grep ssh
730 ? 00:00:00 ssh-agent

Thanks for any more input or advice.


(Note: For anybody else seeing this, the patience thing from unSpawn is because I originally posted this in the Red Hat forum but there was nobody there, so I asked to move this to networking. I was a bit impatient, I reckon. )

Last edited by itsjustme; 12-18-2003 at 04:48 PM.
 
Old 12-18-2003, 11:25 PM   #4
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
nudge...
 
Old 12-19-2003, 02:58 AM   #5
beyer42
Member
 
Registered: Dec 2003
Location: San Jose
Distribution: Redhat WS 3
Posts: 410

Rep: Reputation: 30
For stopping and starting most network services look under
/etc/init.d

example:
/etc/init.d/sshd stop
/etc/init.d/sshd start

looking at the sshd /etc/init.d service script can't hurt, though you should not edit it at all.

Spend a lot of time on http://www.openssh.org
it has excellent FAQs that you should read the FAQs completely.

Also complete man pages for everything ssh is there in html format.

If you want more information on ssh then I would recommend the
Oreilly book on ssh
http://www.oreilly.com/catalog/sshtdg/

From Learning Redhat Linux which I have:

The SSH service has several configuration files, residing in /etc/ssh. You don't have to modify them to get SSH running. If you're curious about them, view the sshd manpage.
 
Old 12-19-2003, 04:55 AM   #6
TheOneKEA
Member
 
Registered: Oct 2003
Distribution: Debian GNU/Linux 11 (amd64) w/kernel 6.0.15
Posts: 299

Rep: Reputation: 30
Check the /var/lock/subsys directory and see if there are any files labelled 'sshd' there. Most of the init.d scripts place a file there for sysmanage utilities to easily check if a service is running, which is especially useful for multi-process services like NFS.
 
Old 12-22-2003, 11:23 AM   #7
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
Thanks for the input.

I went to /etc/init.d and and ran './sshd start' and I got the green [ ok ] line. However, if I do './sshd stop' I get the red [ FAILED ] line. I can do './sshd start' over and over and it says [ OK ] every time.

If I delete /var/lock/subsys/sshd then the status in the services gui says 'sshd is stopped'. Then I click on start or restart, I get the dialogue that it was successful, a new /var/lock/subsys/sshd is created and the status in the gui goes back to the sshd dead thing.

I looked in /etc/init.d/sshd and this is there:
# pull in sysconfig settings
[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd

However, there is no sshd file or directory in /etc/sysconfig.

Here's a 'find' of sshd on the machine:
[root@ssglinux sysconfig]# find / -name 'sshd'
/usr/sbin/sshd
/usr/share/doc/pam_krb5-1.60/krb5afs-pam.d/sshd
/usr/share/doc/pam_krb5-1.60/pam.d/sshd
/var/empty/sshd
/etc/rc.d/init.d/sshd
/etc/pam.d/sshd
/etc/log.d/scripts/services/sshd

Now, the services gui app should start sshd. But apparently something is hosed there.
This is a fairly fresh install of Red Hat 9. I haven't done anything with ssh up to the point where I got the 'sshd dead but subsys locked' thing.

Also, the system is up to date via RHN.

Any more ideas?
 
Old 12-23-2003, 11:26 AM   #8
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
nudge... nudge...
 
Old 12-23-2003, 12:33 PM   #9
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Just out of curiosity (and since you never actually say), can you connect using SSH even with the error messages? What I'm wondering is if sshd is really dead or if the services gui app is just misinterpreting things. You might want to try connecting after a ./sshd start and see what happens. Who knows, then the logs might cough up something useful.
 
Old 12-23-2003, 02:09 PM   #10
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
I can ssh out of the linux box to a solaris box.
I can ssh out of a Windows 2000 box via SecureCRT to the solaris box.

But, if I try to ssh in to the linux box from either SecureCRT or Solaris, I get errors that the hostname can't be found or isn't known. Nothing useful in the /var/log/messages except the start and restart succeeded messages and the stop failed message. Here's the last few lines of that:
-------------------
.
Dec 23 09:40:03 ssglinux gconfd (root-13846): GConf server is not in use, shutting down.
Dec 23 09:40:04 ssglinux gconfd (root-13846): Exiting
Dec 23 09:44:57 ssglinux sshd: sshd shutdown failed
Dec 23 09:44:57 ssglinux sshd: succeeded
Dec 23 09:45:05 ssglinux sshd: sshd shutdown failed
Dec 23 12:44:29 ssglinux sshd: succeeded
-------------------
For this discussion, the machines are:
linux.somedomain.com
solaris.somedomain.com
w2k.somedomain.com

The linux box is happy in the network and can ping all over the place and can use the network printer on the windows side and can access the web, etc.
But, it's not accepting ssh sessions.

Here's /etc/ssh/sshd_config. I was trying to set it up similarly to the solaris box which is serving up ssh without a problem. I think I'll throw an "echo 'test'" in there and see if the start process ever gets to this file. Also, I don't know why anything in this file would cause a 'sshd dead..." status in the gui, but it might, eh?
-------------------
# $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

Port 22
#Protocol 2,1
Protocol 2
#ListenAddress 0.0.0.0
ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

LoginGraceTime 120
PermitRootLogin no
#StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# rhosts authentication should not be used
RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
IgnoreUserKnownHosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
PAMAuthenticationViaKbdInt no

#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
#VerifyReverseMapping no

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
-------------------

Thanks for any more help or insights.
I also thought I might just rpm -e the openssh and reinstall it. But, I don't want to.
 
Old 12-23-2003, 02:16 PM   #11
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
Well, /etc/rc.d/init.d/sshd didn't like the echo's in the /etc/ssh/sshd_config file, but at least it let me know that the start proecess went through there. But still, the stop process gives a 'sshd shutdown failed' message.
There's an sshd in both /etc/init.d and /etc/rc.d/init.d - I've tried them both.

All I want for Christmas is to ssh into this linux box.
 
Old 12-23-2003, 02:41 PM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607Reputation: 3607
if I try to ssh in to the linux box from either SecureCRT or Solaris, I get errors that the hostname can't be found or isn't known.
1. Try by IP address, or stuff the IP/FQDN pair in the originating OS'es /etc/hosts equivalent.

2. If Sshd is running on the Linux box, then when you ssh TO the Linux box add the "-v -v" flags for more verbose info. Check for errors and post the relevant part.

3. If Sshd is NOT running on the Linux box (which should, since it gives " sshd shutdown failed"),
First check if /etc/ssh contains the host keys. Open up another console, xterm, Konsole or whatever it's called. Run "sh -x /etc/rc.d/init.d/ssh start 2>&1|tee /tmp/sshd0.log", check for errors and post the relevant part.
If no errors, "cat /etc/sysconfig/ssh" to see if there's any CLI arguments you need. Check the top of /etc/rc.d/init.d/ssh for arguments. Now run "/usr/sbin/sshd -d -d -d (args) 2>&1|tee /tmp/sshd1.log". If it keeps running, try to log in. If it doesn't check for errors and post the relevant part.
 
Old 12-23-2003, 10:06 PM   #13
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Original Poster
Rep: Reputation: 47
Ok, thanks! Unfortunately I got called off that project today and put on another project today and tomorrow. Then they are closed for the holidays, so I won't be back at this until Jan 5. I printed out the replies and will be back on 'em then.

I was able to try using the ip address and got basically the same result.
And, using the -v option while trying to ssh in from the solaris box, I got some connection refused stuff and the last line was something like "Secure connection refused", or somesuch...

Dang holidays!! uh... huh?

Anyway, back at it next year.

Thanks again!
 
Old 09-08-2005, 10:53 PM   #14
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
i have the same problem noted above:
Code:
[root@hyper ssh]# /usr/sbin/sshd -d -d -d  2>&1|tee /tmp/sshd1.log
debug1: sshd version OpenSSH_3.5p1
debug1: private host key: #0 type 0 RSA1
debug3: Not a RSA1 key file /etc/ssh/ssh_host_rsa_key.
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug3: Not a RSA1 key file /etc/ssh/ssh_host_dsa_key.
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
debug1: Bind to port 22 on 68.80.xxx.xxx.
Bind to port 22 on 68.80.xxx.xxx failed: Cannot assign requested address.
Cannot bind any address.
[root@hyper ssh]#
can someone help me get my ssh server back up?

thx
 
Old 09-08-2005, 11:36 PM   #15
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
i got it.

freakin' comcast changed my ip.

had to update 'ListenAddress' in /etc/ssh/sshd_config

thx
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP : <<< mysqld dead but subsys locked >>> Fr33B5D Linux - Software 13 07-22-2010 02:35 PM
sshd dead but subsys locked phyrko Linux - Networking 9 03-26-2009 06:17 AM
crond dead but subsys locked dpirvulescu Linux - Software 9 04-23-2005 10:09 AM
httpd dead but subsys locked x2000koh Linux - General 5 03-21-2005 06:26 PM
proftpd dead but subsys locked!! NEED HELP!! acegamer Linux - Newbie 0 04-18-2003 10:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration