LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-07-2013, 08:27 AM   #1
shemeza
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Rep: Reputation: Disabled
can't access a remote server via ssh


hi,
i'm trying to send my public key(id_rsa.pub) to a remote server(172.18.3.255) without success. i used the below command
ssh-copy-id -i ~/.ssh/id_rsa.pub root@172.18.3.255

and the output was this:
ssh: connect to host 172.18.3.255 port 22: Connection timed out.

can anybody help me out?

thnx
 
Old 03-07-2013, 08:29 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Ping it and check if it's alive & reachable:
Code:
~$ ping 172.18.3.255
 
Old 03-07-2013, 08:33 AM   #3
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
If its pinging do telnet 172.18.3.255 22
 
Old 03-07-2013, 08:35 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Also check to see if the port ssh listens on is actually 22:
Code:
nmap 172.18.3.255
(or if you have root access to 172.18.3.255):
Code:
netstat -pln | grep "sshd"
 
Old 03-07-2013, 10:07 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by shemeza View Post
and the output was this:
ssh: connect to host 172.18.3.255 port 22: Connection timed out.
The computer is telling you that SSH is either not running, or it is not running on port 22. That or at the very least port 22 is blocked between you and the remote computer.

nmap is your friend for seeing if port 22 is open:

Code:
nmap -p22 <IP_of_Target_here>
That is the first thing you need to run. after that you will need to look into the ssh.conf of the remote system to see if its port has been changed, then if not you need to make sure it is running.
 
Old 03-08-2013, 02:51 AM   #6
shemeza
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
i run the command "nmap -PN22 172.18.19.183" and the output was

Nmap scan report for 172.18.19.183
Host is up.
All 1000 scanned ports on 172.18.19.183 are filtered
Nmap done: 1 IP address (1 host up) scanned in 201.35 seconds

but still i'm not able to ping the 172.18.19.183
 
Old 03-08-2013, 03:05 AM   #7
Rumata
LQ Newbie
 
Registered: Feb 2013
Location: USSR
Distribution: gentoo
Posts: 15

Rep: Reputation: 0
Must be a firewall problem then.
 
Old 03-12-2013, 04:14 AM   #8
shemeza
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
i manage to ping the server but i still have the same output when it's about to copy my id_rsa.pub to the server, "connection time out"
 
Old 03-12-2013, 04:35 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
What do you mean by remote server. The address 172.18.19.183 is a private address. Is the server on your LAN?

If the server isn't on your local LAN, you need to go through the destination's firewall via its Internet IP address, which needs to forward port 22 to the server.
If the server has an interface connected directly to the internet, then you need it's Internet IP address.
 
Old 03-12-2013, 05:37 AM   #10
rahul.sed
LQ Newbie
 
Registered: Dec 2012
Posts: 3

Rep: Reputation: Disabled
check the iptables rules
 
Old 03-12-2013, 07:43 AM   #11
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by shemeza View Post
i run the command "nmap -PN22 172.18.19.183" and the output was

Nmap scan report for 172.18.19.183
Host is up.
All 1000 scanned ports on 172.18.19.183 are filtered

Nmap done: 1 IP address (1 host up) scanned in 201.35 seconds

but still i'm not able to ping the 172.18.19.183
Im not sure what the confusion is shemeza? The output of nmap flat out told you that port 22 is blocked. You either have to configure the firewall, or get whom ever is in charge of that system to grant you permission to ssh in. You will ALWAYS continue to have the same error msg. until you resolve this issue.

It can be caused by one of two things, mainly that is:

1. firewall issues (either hardware or software to include but not limited to iptables)
2. ssh is not running on that server therefore port 22 is not open.
 
Old 03-18-2013, 03:51 AM   #12
shemeza
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
i managed to connect, now it's ok
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Ubuntu server remote ssh and local network ssh issues using putty. scottpops Linux - Server 8 05-17-2012 05:07 PM
not able to access remote via ssh . dharmendrajet Linux - Software 2 03-17-2011 12:21 AM
SSH - Remote aplications in remote server Urien Linux - Newbie 11 04-04-2009 04:02 AM
Remote Access, reverse ssh haxcess Linux - Networking 1 12-09-2005 11:47 AM
Remote access question. (ssh) JohnStormrider Linux - Networking 8 09-20-2005 04:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration