Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: ssh server not working, but "ssh localhost" works

  1. #1
    Join Date
    Jun 2007
    Beans
    35

    Unhappy ssh server not working, but "ssh localhost" works

    I have one computer(computer A) with openssh-server installed, but other computers(computer B and C) in my home cannot ssh to it. They all connected to internet through a router.

    computer-A: ubuntu 9.04, has openssh-server
    computer-B: ubuntu netbook remix
    computer-C: Centos 5, has openssh-server

    A and B can ssh to C, but B and C cannot ssh to A. They all can ssh to outside ssh-servers(eg. a server at school).

    The problem seems on A. I have re-installed ssh server, and tested with "ssh localhost". Everything went well, but still, cannot ssh to A from B and C.

    Does anyone know what is going on here?

  2. #2
    Join Date
    May 2008
    Location
    Baker, OR USA
    Beans
    887
    Distro
    Ubuntu Development Release

    Re: ssh server not working, but "ssh localhost" works

    Are you using IP addresses or names? My computers sometimes don't like names and want IP addresses.
    I don't want to Live in a Life without Walls-too many viruses get in...
    Ubuntu user 23101 Linux user 472132
    Two ways to live: the choice we all face

  3. #3
    Join Date
    Nov 2006
    Location
    Belgium
    Beans
    3,025
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ssh server not working, but "ssh localhost" works

    Quote Originally Posted by kangyu29 View Post
    Does anyone know what is going on here?
    Yes, most likely.

  4. #4
    Join Date
    May 2009
    Location
    Rock Hill SC
    Beans
    120
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ssh server not working, but "ssh localhost" works

    Also, can B & C ping A (by IP or by name)?

    ~John
    If Microsoft ever does applications for Linux it means I've won.
    ~Linus Torvalds (1996-10-16)

  5. #5
    Join Date
    Nov 2008
    Beans
    5
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: ssh server not working, but "ssh localhost" works

    You can login locally, but not from the internet? Then it sounds like you may need to forward port 22 to your server address in your router.

  6. #6
    Join Date
    Aug 2006
    Location
    Australia
    Beans
    1,438

    Re: ssh server not working, but "ssh localhost" works

    Quote Originally Posted by kangyu29 View Post
    The problem seems on A. I have re-installed ssh server, ...
    Yes, I know of this problem.

    Your client computers (B and C) still have a fingerprint (or key, or whatever they're called) that you accepted when you first SSHed to computer A before you re-installed it.
    Because you have since re-installed computer A, the fingerprint has changed - so your client SSH computers (B and C) get a fingerprint mismatch and will hence terminate the SSH connection attempt.

    The easiest way to fix this up (though it's probably not the most elegant), is to simply delete the contents of your ~/.ssh directory on computers B and C. I would recommend you make a backup of your ~/.ssh directory first, just in case.
    Then for every client ssh connection attempt you make on computers B and C to new SSH servers, you will be prompted to accept the fingerprint / key from the SSH server.

    - Then everything should work nicely again
    There may well be a more elegant way to do this, that does not delete the fingerprints / keys from other ssh server's you've previously connected to.
    Work smart, not hard.

  7. #7
    Join Date
    May 2009
    Location
    Rock Hill SC
    Beans
    120
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ssh server not working, but "ssh localhost" works

    Quote Originally Posted by jdakhayman View Post
    You can login locally, but not from the internet? Then it sounds like you may need to forward port 22 to your server address in your router.
    @jdakhayman: I think he is doing the SSH internally. He has the 3 PCs (A, B & C). A & B can ssh to C, but C & B can't ssh to A. A, B & C can ssh to a PC outside the home.

    Do you run any firewall software on PC A? Cause that also will cause troubles with incoming ssh.

    ~John
    If Microsoft ever does applications for Linux it means I've won.
    ~Linus Torvalds (1996-10-16)

  8. #8
    Join Date
    Nov 2006
    Location
    Belgium
    Beans
    3,025
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ssh server not working, but "ssh localhost" works

    wouldn't if be easier if the OP just posts the exact error (copy paste from the terminal) he gets when he does ssh whoever@whereever in stead of having a bunch of people guessing at what the problem might be and randomly throwing solutions at it ?

  9. #9
    Join Date
    Jun 2007
    Beans
    35

    Re: ssh server not working, but "ssh localhost" works

    Quote Originally Posted by SoftwareExplorer View Post
    Are you using IP addresses or names? My computers sometimes don't like names and want IP addresses.
    I use ip address. something like: 192.168.10.2

  10. #10
    Join Date
    Jun 2007
    Beans
    35

    Re: ssh server not working, but "ssh localhost" works

    Quote Originally Posted by jfmanamtr View Post
    Also, can B & C ping A (by IP or by name)?

    ~John
    I didn't try this, I will try it later when I get home and let you know.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •