Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-18-2003, 01:46 PM
|
#1
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Rep:
|
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...
|
|
|
12-18-2003, 02:22 PM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
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?
|
|
|
12-18-2003, 03:44 PM
|
#3
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
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.
|
|
|
12-18-2003, 11:25 PM
|
#4
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
nudge...
|
|
|
12-19-2003, 02:58 AM
|
#5
|
Member
Registered: Dec 2003
Location: San Jose
Distribution: Redhat WS 3
Posts: 410
Rep:
|
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.
|
|
|
12-19-2003, 04:55 AM
|
#6
|
Member
Registered: Oct 2003
Distribution: Debian GNU/Linux 11 (amd64) w/kernel 6.0.15
Posts: 299
Rep:
|
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.
|
|
|
12-22-2003, 11:23 AM
|
#7
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
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?
|
|
|
12-23-2003, 11:26 AM
|
#8
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
nudge... nudge...
|
|
|
12-23-2003, 12:33 PM
|
#9
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
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.
|
|
|
12-23-2003, 02:09 PM
|
#10
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
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.
|
|
|
12-23-2003, 02:16 PM
|
#11
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
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. 
|
|
|
12-23-2003, 02:41 PM
|
#12
|
Moderator
Registered: May 2001
Posts: 29,415
|
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.
|
|
|
12-23-2003, 10:06 PM
|
#13
|
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571
Original Poster
Rep:
|
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!
|
|
|
09-08-2005, 10:53 PM
|
#14
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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
|
|
|
09-08-2005, 11:36 PM
|
#15
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
i got it.
freakin' comcast changed my ip.
had to update 'ListenAddress' in /etc/ssh/sshd_config
thx
|
|
|
All times are GMT -5. The time now is 09:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|