Networking Forums

Networking Forums > Computer Networking > Linux Networking > Iptables filtering question

Reply
Thread Tools Display Modes

Iptables filtering question

 
 
George
Guest
Posts: n/a

 
      05-20-2005, 09:53 AM
Hi all.

Is it posible to use iptables or any other type of filtering for filtering
by user?

Let's explain. I want to allow only one user to access my pc using ssh. I
don't want to filter by using his ip address or any network stuff, but by
its user name (i.e. root, user1, user2) Is it possible?

TA.
 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      05-20-2005, 10:33 AM
On 2005-05-20, George <(E-Mail Removed)> wrote:
> Is it posible to use iptables or any other type of filtering for filtering
> by user?


No. The username isn't in any packets sent by the system.
Davide

--
Windows 95 has been operating for 2 hours, 32 minutes. No errors reported. CALL
GUINESS BOOK OF WORLD RECORDS NOW!
 
Reply With Quote
 
Mikko Rapeli
Guest
Posts: n/a

 
      05-20-2005, 10:45 AM
In article <(E-Mail Removed) >,
Davide Bianchi wrote:
> On 2005-05-20, George <(E-Mail Removed)> wrote:
>> Is it posible to use iptables or any other type of filtering for filtering
>> by user?

>
> No. The username isn't in any packets sent by the system.
> Davide


Oh yes it is possible. man iptables:

....
owner
This module attempts to match various characteristics of
the packet creator, for locally-generated packets. It is only
valid in the OUTPUT chain, and even this some packets
(such as ICMP ping responses) may have no owner, and hence never
match.
....

Combine that with state matching and inbound traffic can be covered as
well.

-Mikko
 
Reply With Quote
 
Syam
Guest
Posts: n/a

 
      05-20-2005, 11:10 AM
man sshd_config.
========
AllowUsers
This keyword can be followed by a list of user name
patterns,
separated by spaces. If specified, login is allowed only
for
user names that match one of the patterns. '*' and
'?' can be
used as wildcards in the patterns. Only user names are
valid; a
numerical user ID is not recognized. By default, login is
allowed for all users. If the pattern takes the form
USER@HOST
then USER and HOST are separately checked, restricting
logins to
particular users from particular hosts.
========

- Syam


George wrote:
> Hi all.
>
> Is it posible to use iptables or any other type of filtering for

filtering
> by user?
>
> Let's explain. I want to allow only one user to access my pc using

ssh. I
> don't want to filter by using his ip address or any network stuff,

but by
> its user name (i.e. root, user1, user2) Is it possible?
>
> TA.


 
Reply With Quote
 
George
Guest
Posts: n/a

 
      05-20-2005, 01:56 PM
Mikko Rapeli <(E-Mail Removed)> wrote in
news:d6kf4o$7d2$(E-Mail Removed):

> In article <(E-Mail Removed) >,
> Davide Bianchi wrote:
>> On 2005-05-20, George <(E-Mail Removed)> wrote:
>>> Is it posible to use iptables or any other type of filtering for
>>> filtering by user?

>>
>> No. The username isn't in any packets sent by the system.
>> Davide

>
> Oh yes it is possible. man iptables:
>
> ...
> owner
> This module attempts to match various characteristics of
> the packet creator, for locally-generated packets. It is only
> valid in the OUTPUT chain, and even this some packets
> (such as ICMP ping responses) may have no owner, and hence
> never match.
> ...
>
> Combine that with state matching and inbound traffic can be covered as
> well.
>
> -Mikko
>



This one is only for the OUTPUT chain so cannot use it with INPUT one (
Could you explain to me what should I do?

Thanks.
 
Reply With Quote
 
Mikko Rapeli
Guest
Posts: n/a

 
      05-20-2005, 02:16 PM
In article <Xns965CA72337A79newsgmxnet@213.0.184.81>, George wrote:
> This one is only for the OUTPUT chain so cannot use it with INPUT one (
> Could you explain to me what should I do?


Woops, I didn't read the original post - just the later one. For your
needs there really is no packet filtering that will do it. User names
are only transfered after the TCP connection is up which requires some
IP packet exchange for the three way handshake

OpenSSH instead has AllowUsers option. See man sshd_config for
details.

-Mikko
 
Reply With Quote
 
George
Guest
Posts: n/a

 
      05-20-2005, 04:04 PM
Thanks anyway I will have a try.

Mikko Rapeli <(E-Mail Removed)> wrote in


news:d6krf2$guu$(E-Mail Removed):

> In article <Xns965CA72337A79newsgmxnet@213.0.184.81>, George wrote:
>> This one is only for the OUTPUT chain so cannot use it with INPUT one
>> ( Could you explain to me what should I do?

>
> Woops, I didn't read the original post - just the later one. For your
> needs there really is no packet filtering that will do it. User names
> are only transfered after the TCP connection is up which requires some
> IP packet exchange for the three way handshake
>
> OpenSSH instead has AllowUsers option. See man sshd_config for
> details.
>
> -Mikko
>




--
Saludos a todos
#
# Contra el terrorismo
#
 
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 and post-NAT filtering Andrew Gideon Linux Networking 0 07-28-2008 11:50 PM
iptables: filtering on src/dest for large set of ip addr whatdoineed2do@yahoo.co.uk Linux Networking 0 10-16-2005 09:56 AM
IPTables filtering what should be allowed outbound traffic SmittyBroham Linux Networking 6 10-03-2005 05:42 PM
Filtering Broadcast by iptables it's possible? Pablo Silva O Linux Networking 1 03-04-2004 03:15 AM
iptables mac based filtering RJ41 Linux Networking 3 09-04-2003 07:18 PM



1 2 3 4 5 6 7 8 9 10 11