LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-01-2008, 06:54 AM   #1
Trd79
LQ Newbie
 
Registered: Aug 2001
Location: Sheffield, UK.
Posts: 16

Rep: Reputation: 0
SSH Connects but no shell prompt


Hi,

Am having very strange problems with a CentOS 4 server. First thing to say is that I do not currently have physical access to the server (It's at work) and am hoping that I do not have to go there!

Got a call to say that server was down and had it re-booted.

On trying to SSH in I get username and password prompt as usual. It seems to log in successfully as I get the 'last logged in at X from Y' message; however, I get no command prompt.

I can get in using webmin, and can access file manager, logs etc that way.

I can also use SCP.

Strangely, when I try to reboot the machine via webmin, it claims to have excecuted the command but does not reboot.

This server is host to two Xen virtual machines which did not start at boot. I need to get in via SSH to find out what is happening.

Any help would be appreciated, I am beginning to contemplate travelling to the server which will not be good!

Tom
 
Old 08-01-2008, 07:57 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

Doesn't look good. Sounds like you've got a corrupted filesystem, as you can't run your login shell, or run commands to reboot the host.
Last time I saw something like this, it was from a corrupted /var FS on Solaris - I was getting a login prompt, but since /var wasn't writable, the 'last' log couldn't be written to so logins just hung.

Any errors in /var/log/messages?

Dave

P.S. Always on a Friday afternoon, eh?

Last edited by ilikejam; 08-01-2008 at 07:59 AM.
 
Old 08-01-2008, 10:12 AM   #3
Trd79
LQ Newbie
 
Registered: Aug 2001
Location: Sheffield, UK.
Posts: 16

Original Poster
Rep: Reputation: 0
Question

Hmmm, don't like the sound of that!

Doesn't seem to be a problem with /var or logging. Last entries in /var/log/messages are as follows:

Code:
Aug  1 15:54:55 rhhlinux1 sshd(pam_unix)[4810]: session opened for user root by (uid=0)
Aug  1 15:55:01 rhhlinux1 sshd(pam_unix)[4810]: session closed for user root
(for any users in different timezones, that was about 10 minutes ago!)

As you can see the session is opened successfully (secure log confirms this). The session is closed by me closing the PuTTY window.
Anything I type is echoed to the terminal, just no shell prompt.

The strange thing is that SCP works (which I think uses the bash shell to do stuff and will not work without a compatible shell).

Have been through other logs and cannot see anything out of the ordinary (although not altogether sure what I should be looking for).

Did think it might be a HDD space issue, but df reports only 60% of space in use.

Any ideas?


(You are right. These things ONLY happen on a Friday!)
 
Old 08-01-2008, 10:51 AM   #4
Trd79
LQ Newbie
 
Registered: Aug 2001
Location: Sheffield, UK.
Posts: 16

Original Poster
Rep: Reputation: 0
Progress - Broken BASH

OK,

Have made progress. Made a new user in webmin with a different default shell (tcsh). Now I get a shell prompt!
Running TOP shows several BASH instances which seem to have hung. I guess that BASH must have got corrupted somehow.

Any suggestions on the safest way to resurrect it? (will probably start off by trying to uninstall and reinstall using yum).

T
 
Old 08-01-2008, 11:04 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
First you can verify the integrity of the bash package:
Code:
rpm -V bash
if something has changed and/or corrupted you have to investigate where the problem arised from. You can always try to reinstall it (maybe you get a newer version). However, it could be something else: has the /etc/bashrc or your ~/.bashrc be changed recently? Does it happen to every user on the system? Did you try to create a new user giving /bin/bash as shell? Has the /etc/passwd file been hacked?

Just some silly questions, trying to exclude the worst options...
 
Old 08-01-2008, 11:58 AM   #6
Trd79
LQ Newbie
 
Registered: Aug 2001
Location: Sheffield, UK.
Posts: 16

Original Poster
Rep: Reputation: 0
It was affecting all users.

After changing default shell I managed to copy a bash excecutable from another machine. Bash is now working! (have kept a copy of the bad one, but am fairly sure that it must have been corrupted somehow).

My worry is that 'shutdown -r now' still does not work - it displays the normal messages but nothing happens.
This suggests that I may have further corruptions somewhere. Don't think I can run fsck from here as I would need to unmount the partition?

I think this is probably going to require a re install at some point, but at least I can access the filesystem now and copy data elsewhere :-)

Back in office on Thursday so guess it will be time for a boot CD and a large coffee!

T
 
  


Reply



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
LXer: Shell tip: Set the shell prompt and themes in Linux Terminal LXer Syndicated Linux News 0 06-12-2007 03:02 AM
PPTP Client connects but cannot ssh or ping any hosts on FC6 kkempter Linux - Networking 0 11-20-2006 09:56 PM
Cisco VPN client connects – no command prompt kender Linux - Networking 1 09-06-2006 07:34 AM
telnet connects but login prompt does not appear jhess Linux - Software 2 10-10-2003 06:05 AM
SSH connects but hangs pdibona Linux - Networking 5 10-09-2002 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:55 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