SSH Problem

Discussion in 'Server Operation' started by colskinet, Aug 2, 2008.

  1. colskinet

    colskinet New Member

    Hi all

    LAN IP
    WAN IP 212.159.x.x

    I have installed Ubuntu 8.04 on a machine that I wish to open up to the internet to serve web pages, and I also wish to access this machine from my work machine using SSH.

    I have installed SSH on it and can access it using my laptop internally on my home network. All works fine.

    I have opened up port 22 on my router and a friend could connect to it from his machine, but we encountered a problem when trying to login. It asks for my username - I put in "username", it then asks for "[email protected]'s password" - whatever I put in it won't accept!

    I temporarily allowed root to login using SSH but this also failed as it appears to be adding on the FQDN to the username when trying to connect externally!

    How do I get around this? This is my first attempt at setting up a Linux server and don't want to be beaten! Sure it's something I haven't done, so feel free to call me stupid! :)

    Thanks in advance for any help.

  2. topdog

    topdog Active Member HowtoForge Supporter

    I think you are sshing to the router that is why you login fails even if u are using the correct password

    To ssh to your machine you need to port forward ssh from your router to your machine
  3. colskinet

    colskinet New Member

    Hi topdog

    Thanks for the reply. So is this something I need to do on my router, or do I need to do more configuration work on SSH?

  4. topdog

    topdog Active Member HowtoForge Supporter

    You need to setup port forwarding on your router.
  5. colskinet

    colskinet New Member

    I've setup port 22 to be forwarded to (Ubuntu PC I wish to access using SSH from an external IP address), but it is still asking for my username with the "" suffix attached..

    Just to clarify, my friend can connect from his PC (externally to my network), it asks for username, then asks for "[email protected]" instead of just "user"..

    Confused, but sure I am missing something very simple here..

    Thanks so far!
  6. falko

    falko Super Moderator ISPConfig Developer

    Please double-check your router settings again.
  7. colskinet

    colskinet New Member

    Hi Falko

    Have re-checked the router settings and it is definitely setup to forward any port 22 traffic to IP address (My Ubuntu PC I wish to remotely connect too..)

    I removed it and re-added it but still no luck.

    When I added this rule on the router, it informed me that it was moving the routers SSH port to 2222.

    The Ubuntu PC will be hosting a web domain ( for example) out to the internet - is there anything else I need to configure on the PC side?

  8. falko

    falko Super Moderator ISPConfig Developer

    Do you remember the exact message?

    You need to install Apache and possibly PHP, Python, Ruby (or whatever sccripting language you prefer), and maybe MySQL if you need databases.
    If you just want to host one web site, you can put it in /var/www, otherwise you need to configure virtual hosts.
  9. ralic

    ralic New Member

    This looks like normal behaviour for ssh.
    If I type:
    ssh [email protected]
    Upon connecting, the sshd asks for my credentials thus:
    [email protected]'s password:
    At which point I have to enter the correct password to proceed further.

    Try connecting like that and entering the password for the user. If it fails, sshd will respond:
    Permission denied, please try again.
    [email protected]'s password:
    Then connect internally and look at the last few lines of /var/log/auth.log
    This is an example of a failed login attempt due to incorrect password.
    [email protected]:~$ tail /var/log/auth.log
    Aug  5 20:53:04 myhost sshd[32097]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=###.###.###.###  user=myloginname
    Aug  5 20:53:06 myhost sshd[32097]: Failed password for myloginname from ###.###.###.### port 51045 ssh2
    [email protected]:~$
    Difficult to say what error you may see though.
  10. colskinet

    colskinet New Member

    Well it is all working now, not sure why or what has changed though!

    Thanks for your help guys.


Share This Page