Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Help with SSH

  1. #1
    Join Date
    Jun 2007
    Location
    Leeds, UK
    Beans
    136
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Help with SSH

    I have installed Ubuntu Server 8.10 on a machine that I intend to run as a headless server.

    I choose to install all of the programs during the installation process except the mail server.

    to kick things off I would just like to be able to connect to the machine via SSH from the other PC's in my house.The other PC's all run Ubuntu and I have installed Open-SSH on them.

    I seem to have fallen at the first hurdle and can't log in via SSH.

    During the set up of the server I used the following settings:

    Hostname = server
    User = blue
    Username = blue
    password = ********

    I left the http proxy as blank

    I can see the server on the network places/network can access to only windows share the print folder.

    I have tried to log in via the command line using:

    ssh blue@server

    but I get the following error message:

    ssh: server: Name or service not known

    I have tried using putty and the host name 'server' but nothing.

    I ran /etc/init.d/ssh start on both the server and client machine and got the notification that they were running.

    Any ideas how I can get this working? I am a bit of a noob

  2. #2
    Join Date
    Aug 2005
    Location
    Boston, MA
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help with SSH

    This sounds like a DNS issue, where it can't resolve the server name. Try using the ipaddress and see if that works. You may want to add the server to the hosts file of the clients.

  3. #3
    Join Date
    Oct 2008
    Location
    Dhaka, Bangladesh
    Beans
    5
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: Help with SSH

    when you log in to the target machine (normally) and open terminal does is show bleu@server ?? I think the target host has a different name other than server. If the terminal shows "blue@green:~$" you should use
    ssh blue@green or
    ssh blue@your_ipaddress

  4. #4
    Join Date
    Sep 2007
    Beans
    134
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Help with SSH

    Name or service not known means that the IP address for the server name is not known. ssh doesn't connect to names, but to IP addresses, so it has to have some way to translate the name to an IP address. Is server defined in your hosts file? (e.g. 192.168.1.123 server)
    If it's not, the computer your trying to ssh from simply doesn't know where to look for server. So add it to your hosts file, or, alternatively (but more of a pain), use it's actual IP address rather than it's name (e.g. ssh blue@192.168.1.123)

    Bob

  5. #5
    Join Date
    Jun 2007
    Location
    Leeds, UK
    Beans
    136
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Help with SSH

    Thanks for the suggestions, I assume I am going to have to assign a fixed IP to the server so that I can access it?

  6. #6
    Join Date
    Dec 2007
    Location
    Buenos Aires, Argentina
    Beans
    1,231
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help with SSH

    Quote Originally Posted by roundhay View Post
    Thanks for the suggestions, I assume I am going to have to assign a fixed IP to the server so that I can access it?
    No need to, and it won't end your problem, because the hostname will be not resolving either, if you can't add it to a DNS server, totally unnecessary for a home LAN, do what hrod beraht told you.
    Add that IP address to your /etc/hosts file, you'll have to use sudo to edit the file, it will have to be something like this:

    Code:
    blue    ip.address.of.blue.here
    If you don't have that many boxes to deal with, it is a crude, fast and a PITA to maintain, way of resolving hostnames
    Live long and prosper.
    And use lotsa Linux, BSD, and Emacs.

  7. #7
    Join Date
    Sep 2007
    Beans
    134
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Help with SSH

    Quote Originally Posted by roundhay View Post
    Thanks for the suggestions, I assume I am going to have to assign a fixed IP to the server so that I can access it?
    Realistically, yes. You don't absolutely have to, but if you just use DHCP and get a different address after every reboot, it would complicate things tremendously - and unnecessarily so, as creating a fixed IP address isn't difficult and is a one-time thing.

    See the Ubuntu Server Guide networking section if you aren't sure how to do a fixed IP.

    Bob

  8. #8
    Join Date
    Sep 2007
    Beans
    134
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Help with SSH

    Quote Originally Posted by hictio View Post
    No need to, and it won't end your problem, because the hostname will be not resolving either, if you can't add it to a DNS server, totally unnecessary for a home LAN, do what hrod beraht told you.
    hictio makes an excellent point. I assumed access only from within a home LAN, which may be a bad assumption. Adding a 192.168.1.xxx address to your hosts file isn't going to work outside of your LAN. If you are accessing your server via SSH from outside your LAN, from the internet, you are actually going to be accessing your router, which will in turn forward to your local 192.168.1.xxx address. So outside your LAN you need to use your router IP address. Or, as hictio mentioned you should ideally have your address in DNS so that you can just use myserver.com or whatever domain name you may have and have it automatically translate into your IP address at home. If you don't have a domain name and want a quick way to get DNS forwarding, consider using the free service at dyndns.com

    Bob
    Last edited by hrod beraht; November 21st, 2008 at 10:32 PM.

  9. #9
    Join Date
    Jun 2007
    Location
    Leeds, UK
    Beans
    136
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Help with SSH

    I have looked at this and it worries me.....

    I have changed the DHCP rage in my router and plan to use 192.168.1.*** as the IP address for the server.

    If I amend the /etc/network/interfaces file how should it look? I know the address and netmask but what is the gateway? Is this the IP of the router?

    iface eth1 inet static
    address 192.168.1.***
    netmask 255.255.255.0
    gateway ????????

    After doing this do I really need to amend the /etc/resolv.conf file? This is the part I am not comfortable with?

    I've struggled with fixed IP's in the past

  10. #10
    Join Date
    Sep 2007
    Beans
    134
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Help with SSH

    Quote Originally Posted by roundhay
    ...what is the gateway? Is this the IP of the router?
    Yep. It's probably 192.168.1.1 To check, you can always just try going to http://192.168.1.1 in your browser and see if you get your router's login.

    Quote Originally Posted by roundhay
    I've struggled with fixed IP's in the past
    Step 1: give your server a static IP as you've started to do below.

    iface eth1 inet static
    address 192.168.1.***
    netmask 255.255.255.0
    gateway ????????

    *** IF YOUR SERVER ISN'T GOING TO BE AVAILABLE ON THE INTERNET, BUT ONLY ON YOUR LOCAL LAN, IGNORE THE STUFF BELOW ***

    Step 2: go into your router setup (usually by going to http://192.168.1.1 in your browser) and forward the appropriate ports. For example, for SSH and HTTP you want to forward ports 22 and 80. Forward them to whatever address your server is, e.g. 192.168.1.xxx

    That's it. Your server is now available on the internet.
    Basically it goes like this:
    Assumptions:
    -- your server's internal IP address is 192.168.1.123
    -- your actual IP address to your router (from you service provider) is 123.456.789.0
    -- you forwarded both ports 22 and 80 in your router to point to 192.168.1.123

    If the above is true, you can - from the internet - type ssh blue@123.456.789.0 and it will go to your router, which will forward it to 192.168.1.123 and voila! your server will ask for your ssh password.

    You could also type into your browser http://123.456.789.0 and your router would forward that http request to 192.168.1.123 and it would be served by your web server (assuming you have one running).

    The DNS part that hictio was mentioning is that if you have a domain name, such as server.com or whatever, you can have that point to 123.456.789.0 in the DNS server world, which would allow you to simply type ssh blue@server.com or http://server.com and the DNS servers would then translate the server.com part to 123.456.789.0 and then it would go to your router and as before your router would forward the request to 192.168.1.123

    It's really pretty simple Hopefully that helps clear things up rather than makes it more confusing.

    Bob

Page 1 of 2 12 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
  •