LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   ssh not working anymore (http://www.linuxquestions.org/questions/linux-software-2/ssh-not-working-anymore-631728/)

astroboiii 03-30-2008 02:01 PM

ssh not working anymore
 
Was on my laptop one night, putty'd into my local ubuntu server and I shutdown my laptop without exiting my putty session. Now I cannot log into my linux server in any way except locally (on the 'nix box itself that is).

I have uninstalled and reinstalled openssh-server/client and nothing seems to work.

Any help would be greatly appreciated.

Thank You

osor 03-30-2008 02:11 PM

Perhaps you have an inconsistent utmp or wtmp file (see man utmp) which might throw off the ssh server. Try removing them from a livecd (with a backup of course).

astroboiii 03-30-2008 03:11 PM

Thank you for the immediate response!

I will try what you have requested once Ifind out more about utmp (as far as I can tell it keeps track of logins/logouts on the system).


however restarting the server yields the same broken ssh results so I'm not sure if it will help.

astroboiii 03-30-2008 07:48 PM

still having no luck getting it going :confused:

jlinkels 03-30-2008 10:15 PM

Have you checked /var/log/system, /var/log/auth and /var/log/messages on you Ubuntu box? Any ssh problems *should* show up there.

Also, try to ssh from a console on you Ubuntu machine into the machine itself. Might sound weird, but it works. If you succeed, there is nothing wrong with your server, but indeed on the client side. Do this experiment with the same user name as used on the laptop. If you are logged in differently on the Ununtu machine, use:
Code:

ssh -l -username-as-on-the-laptop localhost
jlinkels

astroboiii 03-31-2008 07:53 PM

checking /var/log/auth every time I log in i get this

Mar 31 19:45:01 astro CRON[12239]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 31 19:45:01 astro CRON[12239]: pam_unix(cron:session): session closed for user root

and as usual my ssh session just times out

and I can login locally on the ubuntu box, so the server is most likely running fine as you said.

I was getting a bind issue but found that if I go into my sshd_config file and uncomment the ListenAddress 0.0.0.0 line and that removed the binding error but still wouldn't allow me to log in.

thank's again for all your help everyone.

linux1000 03-31-2008 08:10 PM

try to run ssh with -v -v or -vv to get more debugging info from the ssh connection

Code:

ssh -v -v -l -username-as-on-the-laptop localhost
Quote:

Originally Posted by astroboiii (Post 3106469)
checking /var/log/auth every time I log in i get this

Mar 31 19:45:01 astro CRON[12239]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 31 19:45:01 astro CRON[12239]: pam_unix(cron:session): session closed for user root

and as usual my ssh session just times out

and I can login locally on the ubuntu box, so the server is most likely running fine as you said.

I was getting a bind issue but found that if I go into my sshd_config file and uncomment the ListenAddress 0.0.0.0 line and that removed the binding error but still wouldn't allow me to log in.

thank's again for all your help everyone.


astroboiii 03-31-2008 08:29 PM

I'm not sure what you mean exactly, do you mean run ssh -v on the ubunto box? I don't see how that would help as it would be local.

Unless you meant something else.

Just to note, I am using Putty on my XP laptop to ssh in to the ubuntu box.

jschiwal 03-31-2008 09:08 PM

I am surprised that you could ever ssh into an Ubuntu box as root. Root logins are supposed to be disabled, and it is best practice to disable logging into ssh as root. Can you log in as a regular user on the ubuntu box?

Check if the ssh daemon is running on the Ubuntu box. Also use a telnet client to see if you get a response:
Code:

telnet hpmedia 22
Trying 192.168.1.105...
Connected to hpmedia.
Escape character is '^]'.
SSH-2.0-OpenSSH_4.6

Do you see a similar message?

astroboiii 03-31-2008 09:10 PM

I was never logging in as root, but instead as a particular user. Sorry for the misunderstanding. Also I cannot even telnet to the ssh server on port 22 from my windows box. Everything works locally, but nothing works from the outside in.

ssh is definitely running.

jschiwal 04-01-2008 08:16 AM

It sounds like either the service isn't running or port 22 is blocked by the firewall.

astroboiii 04-01-2008 06:16 PM

I'm not too sure myself. Well I do know for certain that the firewall is working fine (by that I mean my router).

I mean I haven't changed anything in the ubuntu box either so I shouldn't have to go into any messy iptables type of thing.

as for the service itself, if it's working locally than it should be running fine.... i have no clue what could be going wronte here, even removing/re-installing the the ssh package didn't work.

just lost as to wthell this thing is doing.

jschiwal 04-01-2008 11:59 PM

Doesn't Ubuntu have a firewall configuration program for the Linux firewall?

Are you trying to ssh into the Linux box from the LAN or the internet. If from the internet, make sure your router forwards port 22 to your Linux box. If from the LAN, then it still sounds like either the service isn't running or the ports are blocked.

Look at "netstat -l" and see if the ssh service is listening. Also check your /etc/hosts.allow & /etc/hosts.deny files.


All times are GMT -5. The time now is 08:37 AM.