Networking Forums

Networking Forums > Computer Networking > Linux Networking > I need to allow to login to Linux pc from particular IP addr only - Can I do that with IPtables command?

Reply
Thread Tools Display Modes

I need to allow to login to Linux pc from particular IP addr only - Can I do that with IPtables command?

 
 
GS
Guest
Posts: n/a

 
      01-28-2006, 06:30 PM
I have Linux machine at home, which I need to access remotely. I need
to allow to login to Linux pc from particular IP addr only - Can I do
that with IPtables command?.

 
Reply With Quote
 
 
 
 
d
Guest
Posts: n/a

 
      01-28-2006, 11:02 PM
This web page might give you some ideas.

http://www.itc.virginia.edu/unixsys/sec/hosts.html

 
Reply With Quote
 
Robert
Guest
Posts: n/a

 
      01-29-2006, 03:09 AM
On Sat, 28 Jan 2006 11:30:45 -0800, GS wrote:

> I have Linux machine at home, which I need to access remotely. I need
> to allow to login to Linux pc from particular IP addr only - Can I do
> that with IPtables command?.


Sure. What kind of login are you thinking of? SSH? Telnet? HTTP?
HTTPS?


--

Regards
Robert

Smile... it increases your face value!


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
Allen McIntosh
Guest
Posts: n/a

 
      01-29-2006, 03:02 PM
d wrote:
> This web page might give you some ideas.
>
> http://www.itc.virginia.edu/unixsys/sec/hosts.html
>


Blocking with hosts.deny can be much too late if someone is exploiting a
security hole. (e.g. the SSH V1 exploit from a few years back.) My
personal take on this is
1) Only allow SSH through my hardware firewall. Nothing else. No
telnet, rlogin, ftp,...
2) Only allow SSH V2.
3) Use iptables to restrict access. (Before I did this, the number of
breakin attempts was scary.) Here is the relevant fragment:

-A INPUT -p tcp -m tcp --dport 22 --syn -j ssh-rules
# SSH rules.
-A ssh-rules -s 192.168.1.0/24 -j ACCEPT
-A ssh-rules -j DROP

Without a hardware firewall I would be much tougher on SYN packets.
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      01-29-2006, 06:12 PM
I do telnet and ssh (both), if I add my outside hosts IP address in
hosts.allow, will it be OK?. I don't know how to login using http, can
I do with http just like how I do with ssh/telnet?. Thanks.

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      01-29-2006, 07:29 PM
On 29 Jan 2006 11:12:23 -0800, GS wrote:
> I do telnet


I hope you know telnet login id and password is passed as clear text.
Suggest just using ssh, that also allows you to run gui applications
on your box with the display sent back to your box.

> and ssh (both), if I add my outside hosts IP address in
> hosts.allow, will it be OK?.


If /etc/hosts.deny has
ALL: ALL: <==== followed by a carriage return.

It would be even better if you poke a hole in your firewall which
allows only your ip address through for ssh.


 
Reply With Quote
 
Pascal Bourguignon
Guest
Posts: n/a

 
      01-29-2006, 08:24 PM
"GS" <(E-Mail Removed)> writes:

> I do telnet and ssh (both), if I add my outside hosts IP address in
> hosts.allow, will it be OK?. I don't know how to login using http, can
> I do with http just like how I do with ssh/telnet?. Thanks.


With http, you generally type your url in a browser, eg.:

lynx http://your.host/

You can also use telnet to "log in" your http server:

telnet your.host 80


--
__Pascal Bourguignon__ http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      01-29-2006, 10:56 PM
I looked into thi spage, thi stells me to add entry into /etc/hosts.all
and hosts.deny file.

if I add just an IP address of the external PC, in /etc/hosts.allow
file will it be Ok?.

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      01-29-2006, 11:08 PM
On 29 Jan 2006 15:56:36 -0800, GS wrote:
> I looked into thi spage, thi stells me to add entry into /etc/hosts.all
> and hosts.deny file.


you put
ALL: ALL
in /etc/hosts.deny

And in /etc/hosts.allow
sshd: 68.192.220.199

> if I add just an IP address of the external PC, in /etc/hosts.allow
> file will it be Ok?.


I assume you have a carriage after each line and the firewall does not
block you.

For extra points, try doing a

man hosts.allow
man hosts.deny


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables command ignored? AAW Linux Networking 8 09-28-2007 10:11 PM
Questions related to iptables command jeniffer Linux Networking 5 11-08-2006 11:52 AM
iptables: filtering on src/dest for large set of ip addr whatdoineed2do@yahoo.co.uk Linux Networking 0 10-16-2005 09:56 AM
What's wrong with this iptables command? Alec Waters Linux Networking 4 11-18-2003 07:53 AM
help with iptables command richard noel fell Linux Networking 3 09-26-2003 06:31 PM



1 2 3 4 5 6 7 8 9 10 11