LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh in Ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-in-ubuntu-805109/)

yewint 04-30-2010 02:52 AM

ssh in Ubuntu
 
Hi geeks,
I have two linux machines and LAN between them. The one is Ubuntu9.10 server and another one Ubuntu8.4 desktop. The hostname of the server is
"ubuntuserver" and the client one "Ubuntu-Linux". I try to access the server with ssh command from client, as in the ssh tutorial found on google search.

Quote:

$ ssh ubuntuserver
all i got is the error ,"ssh: ubuntuserver: Name or service not known"

I am new to ubuntu networking and ssh.I have no idea how to solve it.
I can sucessfully ping to each machines.Any can help me out please?

PMP 04-30-2010 03:05 AM

Try ssh with ip rather than hostname

EricTRA 04-30-2010 03:10 AM

Hi,

Also, check on the server that SSH is running and listening for connections. You can do that with this command:
Code:

sudo netstat -al | grep ssh
which should give you something like this:
Code:

tcp        0      0 *:ssh                  *:*                    LISTEN
Kind regards,

Eric

yewint 04-30-2010 03:12 AM

Quote:

Try ssh with ip rather than hostname
hi , I got this error again

Quote:

ssh: connect to host 192.1.254.103 port 22: No route to host

yewint 04-30-2010 03:17 AM

Quote:

Originally Posted by EricTRA (Post 3952694)
Hi,

Also, check on the server that SSH is running and listening for connections. You can do that with this command:
Code:

sudo netstat -al | grep ssh
which should give you something like this:
Code:

tcp        0      0 *:ssh                  *:*                    LISTEN

Hi i got nothing .. does it mean that ssh is not running? if so how to run it?

yewint 04-30-2010 03:21 AM

but when i try in client one , i got this

Quote:

unix 2 [ ACC ] STREAM LISTENING 13832 /tmp/keyring-5a1zOh/ssh

PMP 04-30-2010 03:22 AM

On this server 192.1.254.103.

See whether ssh is up and running if it si not running

start it
Code:

/etc/init.d/sshd start

EricTRA 04-30-2010 03:25 AM

Quote:

Originally Posted by yewint (Post 3952700)
Hi i got nothing .. does it mean that ssh is not running? if so how to run it?

Hello,

PMP already posted how to start it. But did you install it on your server? If it's the same as Debian, then it's not installed by default and you should install it with:
Code:

sudo apt-get install ssh
accepting the dependencies. After that you should be able to connect.

Kind regards,

Eric

yewint 04-30-2010 03:34 AM

ah, there is no such file as sshd under /etc/init.d/
how do i do? ssh , the one i have now is already installed with the server.

EricTRA 04-30-2010 03:44 AM

Hello,

What do you mean by 'the one I have now'? Did you install a SSH server when you installed Ubuntu server? Can you post the output of following command:
Code:

which sshd
Kind regards,

Eric

EricTRA 04-30-2010 03:48 AM

Hi,

Just saw little error in the post of PMP. The command to start SSH daemon is:
Code:

sudo /etc/init.d/ssh start
if you are logged in as user. If you're logged in as root then you don't have to put the sudo in front. But it's 'ssh', without the 'd', at least on my Debian server (and since Ubuntu is based on Debian I don't think they have changed that).

Kind regards,

Eric

PMP 04-30-2010 04:17 AM

@EricTRA

Correct !!, Thanks

yewint 04-30-2010 04:26 AM

no file as ssh under /etc/init.d/ as well .
do i need to reinstall ssh on the server?

yewint 04-30-2010 04:33 AM

oh , the command "which sshd" prompts nothing. It seems i forgot to install ssh server when i install ubuntu server.

EricTRA 04-30-2010 04:54 AM

Hello,

So, that's why you cannot connect :)

Install it by typing in a terminal:
Code:

sudo apt-get install ssh
if you're logged in as user, or without the sudo if you're root.

Kind regards,

Eric


All times are GMT -5. The time now is 02:51 PM.