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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-26-2010, 09:09 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2008
Posts: 13
Rep:
|
Logging into linux server via SSH - allowed ip addresses
Is there somewhere in WHM where I can allow and disallow various ip addresses to login using PuTTY for SSH.
OpenSSH Server, is not running (for security reasons).
If OpenSSH is not running, is there a way to allow certain ip addresses only to use ssh.
Security plugins i have are
ConfigServer Security&Firewall
Mod Security
|
|
|
|
08-26-2010, 09:36 AM
|
#2
|
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,321
|
I don't know whether the SSH server has the ability to filter incoming traffic by IP. You could, however, implement such filtering fairly easily with an iptables script to block specified IP traffic on port 22. Some might argue that in terms of security, this would be a better approach.
--- rod.
|
|
|
1 members found this post helpful.
|
08-26-2010, 10:00 AM
|
#3
|
|
Member
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704
Rep:
|
Quote:
|
If OpenSSH is not running, is there a way to allow certain ip addresses only to use ssh.
|
Do you mean to say sshd deamon is not running ?
If yes, then you cannot login through ssh client from any IP address.
If sshd deamon is running then,
As suggested by theNbomr it is possible to drop the incoming traffic to port 22 through IPtables for selected IP addresses.
Add following Iptable rule
Code:
iptables -A INPUT -s <IP_to_be_blocked> -p tcp --dport 22 -j DROP
You can also use /etc/hosts.deny file to deny specific IP addresses
Code:
sshd: <IP_to_be_blocked>
|
|
|
1 members found this post helpful.
|
08-26-2010, 01:42 PM
|
#4
|
|
Moderator
Registered: May 2001
Posts: 24,964
|
Quote:
Originally Posted by vinaytp
You can also use /etc/hosts.deny file to deny specific IP addresses
|
An iptables rule set, as mentioned before, would be the safer option, security-wise.
|
|
|
1 members found this post helpful.
|
08-26-2010, 01:50 PM
|
#5
|
|
Member
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704
Rep:
|
Quote:
Originally Posted by unSpawn
An iptables rule set, as mentioned before, would be the safer option, security-wise.
|
I have also read regarding this, blocking traffic for a particular port in iptables is saffer than blocking through tcp_wrappers.
But how to justify this ? On what basis the above statement holds true ?
|
|
|
1 members found this post helpful.
|
08-26-2010, 03:13 PM
|
#6
|
|
LQ Newbie
Registered: Nov 2008
Posts: 13
Original Poster
Rep:
|
allowing an ip address shell access
Thanks,
My particular problem is that I am unable to login to the server using PuTTY from my own ip address. I have previously asked the server management to allow my ip address access and they did so, but as my ip address changes, i do not want to bother them with it every time my ip changes, which seems to happen if I switch on/off my router.
Is there a way I can specify which ip addresses are allowed rather than disallowed?
|
|
|
|
08-26-2010, 03:17 PM
|
#7
|
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,321
|
Quote:
I have also read regarding this, blocking traffic for a particular port in iptables is saffer than blocking through tcp_wrappers.
But how to justify this ? On what basis the above statement holds true ?
|
My logic on the matter would be that the earlier that traffic is blocked, the less opportunity there would be for undesirable behavior. As I understand it, the IP stack will not even see a packet that has been dropped by the netfilter/iptables layer.
--- rod.
Last edited by theNbomr; 08-26-2010 at 03:18 PM.
|
|
|
1 members found this post helpful.
|
08-26-2010, 11:28 PM
|
#8
|
|
LQ Newbie
Registered: Oct 2007
Location: Austin/Warsaw
Distribution: oSuse 11.1
Posts: 12
Rep:
|
Quote:
Originally Posted by chips11
Thanks,
My particular problem is that I am unable to login to the server using PuTTY from my own ip address. I have previously asked the server management to allow my ip address access and they did so, but as my ip address changes, i do not want to bother them with it every time my ip changes, which seems to happen if I switch on/off my router.
Is there a way I can specify which ip addresses are allowed rather than disallowed?
|
notify them you would like a static IP configuration rather than, what I will assume, is your current DHCP setup.
|
|
|
1 members found this post helpful.
|
08-26-2010, 11:52 PM
|
#9
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,261
|
|
|
|
1 members found this post helpful.
|
08-27-2010, 03:43 PM
|
#10
|
|
LQ Newbie
Registered: Nov 2008
Posts: 13
Original Poster
Rep:
|
allowing an ip address shell access
I found out that the way to add an ip in the SSH allow list from WHM >> > Security Center >> Host Access Control option.
There you can just choose which ip addresses are allowed shell access.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:04 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|