LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 03-09-2009, 05:31 AM   #1
xavi08
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Rep: Reputation: 0
Help!! Give ssh acces on centos 5.2


hi all the world.
i am a beginner in linux technology.
i installed centos 5.2 on HP server.
i need to give external access to my server.so other users out of my loval network can connect to via SSH.
in my local network all is well.
but when other users (out of my local network) try to access the could not.
please show me how to give access to my serevr via ssh.

Thnaks a lot
 
Old 03-09-2009, 06:14 AM   #2
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Quote:
If the server has inbound access from outside world use firewall rules. Otherwise to quickly do what you want:

In /etc/hosts.deny

Code:
sshd : ALL : deny
In /etc/hosts.allow given LAN of 192.168.0.0/24

Code:
sshd : \
192.168.0.0/255.255.255.0 \
: allow
Then add networks that are allowed as you need to
Disregard, misinterpreted question

Last edited by TBC Cosmo; 03-10-2009 at 10:13 AM. Reason: Answers wrong question
 
Old 03-09-2009, 06:24 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,345

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
that doesn't seem to address to OP... you got it the wrong way round.

What is the "outside" here? Internet? If so it sounds like you'll need a nat on your internet facing devices to route traffic for port 22 into the server, but you've provided so little information it's hard to suggest much of use.
 
Old 03-09-2009, 06:29 AM   #4
smus
Member
 
Registered: Nov 2005
Location: Turkey
Distribution: Suse
Posts: 104

Rep: Reputation: 16
i think also firewall is up and running..
 
Old 03-09-2009, 06:39 AM   #5
xavi08
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Original Poster
Rep: Reputation: 0
re:

i have forwardee routing to teh port 22 according to teh local address of the server.
i have an active firewall with ssh checked.
i am waiting your questions and solutions .please help.
 
Old 03-09-2009, 06:42 AM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
So what happens when you try to connect via ssh?
 
Old 03-09-2009, 07:00 AM   #7
xavi08
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Original Poster
Rep: Reputation: 0
when i am using pitty to connect to my server out of my local network.
i get the messsage:
network error.connection refused
 
Old 03-09-2009, 07:11 AM   #8
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Quote:
Originally Posted by acid_kewpie View Post
that doesn't seem to address to OP... you got it the wrong way round.


Seems you are right, missed the point of the question.
 
Old 03-09-2009, 07:14 AM   #9
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Quote:
Originally Posted by xavi08 View Post
when i am using pitty to connect to my server out of my local network.
i get the messsage:
network error.connection refused
As mentioned above, make sure that the centos firewall is off
 
Old 03-09-2009, 07:14 AM   #10
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
Sounds like a firewall issue to me. Does /var/log/secure tell you after a failed attempt? If there's no log entry, something is stopping the connection attempt getting to the server.

Are you sure the ssh server is running? Try "netstat -nalp | grep :22". You should see "sshd" listed.
 
Old 03-09-2009, 07:16 AM   #11
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
Quote:
Originally Posted by TBC Cosmo View Post
As mentioned above, make sure that the centos firewall is off
You are kidding aren't you? The OP needs to make sure that the firewall isn't blocking port 22, but don't tell him to shut it off.
 
Old 03-09-2009, 07:21 AM   #12
xavi08
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Original Poster
Rep: Reputation: 0
thanks a lot for your replies.
when i ma typing netstat -nalp | grep :22.
i find ssh is listed and it is port is 22.
i will try to disable my firewall and see what happens.
 
Old 03-09-2009, 07:30 AM   #13
xavi08
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Original Poster
Rep: Reputation: 0
i desacted my centos firewall
this gives nothing special.
please help i need to have SSH access ASAP.
 
Old 03-09-2009, 07:50 AM   #14
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Quote:
Originally Posted by billymayday View Post
You are kidding aren't you? The OP needs to make sure that the firewall isn't blocking port 22, but don't tell him to shut it off.
Why would you need to run the local firewall assuming that this server is in a protected network? There is virtually no information to go on and it is likely that this person will not know what to do. So in the interest of ruling out that as a problem, it should be disabled.
 
Old 03-09-2009, 09:19 AM   #15
xavi08
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Original Poster
Rep: Reputation: 0
my firewall is disabled.
please what to do to get access to my server via ssh.

in my local network all is well.
while for out of my network i get message:
network error;connection refused


pleaaaaaaaaaaase help i need it ASAP.
Thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to allow and deny ssh acces to certain IPs caedo Linux - Security 4 09-19-2008 11:47 AM
SSH and VNC acces problems Fede.mac Linux - Networking 6 08-10-2008 04:01 PM
mc and gpm fraud via ssh (remote acces lockup report - resolved) SCerovec Slackware 2 06-23-2008 03:40 AM
Controlling remote acces SSH Wimpie22 Linux - Security 9 07-27-2005 04:33 PM
no acces with ssh kvtournh Linux - Networking 3 12-11-2003 08:29 AM


All times are GMT -5. The time now is 03:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration