Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mit IPTABLES einen User "einsperren"
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
IINeOII
n00b
n00b


Joined: 29 Aug 2003
Posts: 43

PostPosted: Sat Feb 21, 2004 8:35 am    Post subject: Mit IPTABLES einen User "einsperren" Reply with quote

Hi leute ich habe folgendes problem,

ich versuche seit einiger Zeit einen User (am client) so weit einzuschränken das er nicht aufs internet zugreifen kann, sondern nur auf den server.

quwasi soll er den server einwandfrei erreichen können aber nicht das i-net

so meine frage:

Giebt es möglichkeiten außer iptables (mit denen krieg ichs nich hin) einen User auf ein Bestimmtes Interface zu binden z.b. vm auf eth0:0 mit ip 192.168.1.2 am servert bräuchte ich dann nurnoch das i-face eth0:0 192.168.1.1 und könnte den rest über iptables steuern, hat jemand ne idee hab schon rum gegoogelt finde aber nix.
Back to top
View user's profile Send private message
Beforegod
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 1494
Location: Frankfurt/Main

PostPosted: Sat Feb 21, 2004 10:23 am    Post subject: Reply with quote

Läuft der Zugriff aus Internet über nen Proxy oder über NAT?
Back to top
View user's profile Send private message
IINeOII
n00b
n00b


Joined: 29 Aug 2003
Posts: 43

PostPosted: Sat Feb 21, 2004 11:46 am    Post subject: Reply with quote

über NAT mit postrouting fürs subnet
Back to top
View user's profile Send private message
toskala
Advocate
Advocate


Joined: 14 Dec 2002
Posts: 2080
Location: hamburg, germany

PostPosted: Sat Feb 21, 2004 11:57 am    Post subject: Reply with quote

also wenn man iptables mich nicht anlügt kann es sowas wohl.

Quote:
owner
This module attempts to match various characteristics of the packet creator, for locally-gener-
ated 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.

--uid-owner userid
Matches if the packet was created by a process with the given effective user id.

--gid-owner groupid
Matches if the packet was created by a process with the given effective group id.

--pid-owner processid
Matches if the packet was created by a process with the given process id.

--sid-owner sessionid
Matches if the packet was created by a process in the given session group.

--cmd-owner name
Matches if the packet was created by a process with the given command name. (this option
is present only if iptables was compiled under a kernel supporting this feature)

_________________
adopt an unanswered post
erst denken, dann posten
Back to top
View user's profile Send private message
IINeOII
n00b
n00b


Joined: 29 Aug 2003
Posts: 43

PostPosted: Sat Feb 21, 2004 2:10 pm    Post subject: Reply with quote

Jo ich kenne das schon habs auch mit owner match probiert aber irgendwie will das nich so wirklich weil wenn ich bsp:

owner vm wird umgeleitet nach 192.168.1.1
dies ist die addresse des alias interfaces eth0:0 aufm server

die packete kommen jetzt zwar nicht mehr ins i-net aber der user kann auch nicht mehr mit dem server kommuniziern schätze das liegt daran das er keine antwort erhalten kann weil der server denkt die ip packete kommen weiterhin von 192.168.0.2 was sie ja auch tun, sowas in der richtung halt bin grad verwirrt
Back to top
View user's profile Send private message
ruth
Retired Dev
Retired Dev


Joined: 07 Sep 2003
Posts: 640
Location: M / AN / BY / GER

PostPosted: Sat Feb 21, 2004 5:17 pm    Post subject: Reply with quote

hi,
geht doch ;-) aber ned so out-of-the-box...hihi ;-)
schau mal hier:
Code:

--snip--
The patch allows you to use the owner match in the INPUT chain to match
properties of the receiving socket. It is mainly intended to help filter weird
protocols like H.323 or IIOB without conntrack helpers, but could also come
handy for local user traffic accounting and similar stuff.

Usage:
   iptables -A INPUT -m udp/tcp -m owner ...

Example:

   # Allow packets on eth0 to sockets owned by local user gnugk
   
   iptables -A INPUT -i eth0 -p udp -m owner --uid-owner gnugk -j ACCEPT
   iptables -A INPUT -i eth0 -p tcp -m owner --uid-owner gnugk -j ACCEPT
--snip--

zu finden auf www.netfilter.org -> sektion patch-o-matic -> extra repository...

hoffe, geholfen zu haben ;-)
also die OUTPUT chain wie im posting von oben schon (toskala), dann INPUT chain mit dem patch.
schon gehts...

gruss
rootshell
_________________
"The compiler has tried twice to abort and cannot do so; therefore, compilation will now terminate."
-- IBM PL/I (F) error manual
Back to top
View user's profile Send private message
henri
Apprentice
Apprentice


Joined: 15 Nov 2002
Posts: 182
Location: Germany

PostPosted: Thu Mar 10, 2005 7:09 am    Post subject: Reply with quote

Hi Ruth,

da Du hier von Patch-o-matic redest und ich bisher auf meine Frage, wie man patch-o-matic am besten mit Gentoo verwendet noch keine Antwort bekommen habe, frag ich einfach mal Dich ;-)

Wie verwendest Du denn patch-o-matic mit gentoo? Installierst Du iptables dann manuell (ohne emerge)?
Und wenn ja, wie verhinderst Du ein automatisches Update ohne jedes Mal, wenn eine neue Iptables Version in portage auftaucht, diese zu maskieren? - Ich denke, das wäre notwendig, da patch-o-matic ja auch die Sourcen von Iptables benötigt. Oder liege ich da falsch?

Wäre nett, wenn Du (Nicht nur mir ;-) ) diese Frage beantworten könntest.

Mit freundlichem Gruss,
Henri
Back to top
View user's profile Send private message
moe
Veteran
Veteran


Joined: 28 Mar 2003
Posts: 1289
Location: Potsdam / Germany

PostPosted: Thu Mar 10, 2005 8:27 am    Post subject: Reply with quote

henri wrote:
Hi Ruth,

Wie verwendest Du denn patch-o-matic mit gentoo?

Wäre nett, wenn Du (Nicht nur mir ;-) ) diese Frage beantworten könntest.


Darf ichs auch tun? ;-)
euse -i extensions wrote:

local use flags (searching: extensions)
************************************************************
[- ] extensions (net-firewall/iptables):
Enable support for 3rd patch-o-matic extensions


HTH Maurice
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Thu Mar 10, 2005 9:46 am    Post subject: Reply with quote

-–- gelöscht -–-

Last edited by TheSmallOne on Sat Dec 22, 2012 12:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Thu Mar 10, 2005 10:42 am    Post subject: Reply with quote

Quote:
für sowas braucht man weder Aliase noch irgendwelche Umleitungen... oder habe ich irgendwas falsch verstanden?


Das gleiche habe ich auch gerade gedacht ....

Warum einfach, wenn es auch kompliziert geht...
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Thu Mar 10, 2005 1:16 pm    Post subject: Reply with quote

@ IINeOII

Also ich habe das richtig verstanden wenn es um einen "Multi-User-Client" bei dem alle User außer User X ins Internet dürfen. Oder geht es evt. doch darum das ein kompletter Client nicht ins Internet darf, die anderen Clients aber schon.

Wenn das erste Szenario, dann finde ich auch das Post von TheSmallOne sehr passend.
Back to top
View user's profile Send private message
Ragin
l33t
l33t


Joined: 14 Apr 2003
Posts: 776

PostPosted: Thu Mar 10, 2005 2:50 pm    Post subject: Reply with quote

Sollte es das Szenario sein, dass du einfach nur einen anderen PC nicht im Internet frei geben willst kannst du ja die IP Adresse einfach blocken oder generell (je nachdem, wie groß dein Netzwerk ist) nur bestimmte IP-Adressen für das Internet freigeben.
_________________
"Innerhalb der Computergemeinschaft lebt man nach der Grundregel, die Gegenwart sei ein Programmfehler, der in der nächsten Ausgabe behoben sein wird."

Clifford Stoll, amerik. Astrophysiker u. Computer- Pionier
Back to top
View user's profile Send private message
ro
Apprentice
Apprentice


Joined: 28 Mar 2003
Posts: 289

PostPosted: Thu Mar 10, 2005 4:57 pm    Post subject: Reply with quote

zB:

iptables -A OUTPUT -m owner --uid-owner $USERID -p tcp --tcp-flags SYN,ACK,FIN,RST SYN -j REJECT

ist natürlich nicht komplett, aber ne kleine quick'n'dirty lösung.
_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Thu Mar 10, 2005 6:16 pm    Post subject: Reply with quote

-–- gelöscht -–-

Last edited by TheSmallOne on Sat Dec 22, 2012 12:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
reptile
Guru
Guru


Joined: 19 Nov 2002
Posts: 363

PostPosted: Thu Mar 10, 2005 9:30 pm    Post subject: Reply with quote

oder er hat sich jetzt komplett selbst aus dem internet ausgesperrt ;)
Back to top
View user's profile Send private message
henri
Apprentice
Apprentice


Joined: 15 Nov 2002
Posts: 182
Location: Germany

PostPosted: Mon Mar 14, 2005 5:34 pm    Post subject: Reply with quote

moe wrote:

Darf ichs auch tun? ;-)
euse -i extensions wrote:

local use flags (searching: extensions)
************************************************************
[- ] extensions (net-firewall/iptables):
Enable support for 3rd patch-o-matic extensions


HTH Maurice


Ja klar, gerne.

Wenn ich das richtig gesehen habe, werden dann nur zwei zusätzliche patches installiert.
Ich möchte gerne string-match support.

Ich hab natürlich auch schon patch-o-matic-ng installiert, aber ich bekomme es einfach nicht hin, dass "emerge iptables" trotz FEATURES="... keeptmp" die von emerge entpackten und mit den gentoo patches gepatchten Sourcen NICHT löscht damit ich hinterher patch-o-matic darauf loslassen kann.

Wie mach ich das denn bitte am besten?

Vielen Dank schomal im Voraus,
Gruss Henri
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Wed Mar 16, 2005 7:56 am    Post subject: Reply with quote

Also wenns um Patchen "während" des emerge geht habe ich einen "Workaround"... nach dem entpacken und patchen der Quellen (durch emerge) schnell STRG + Z drücken um den Prozess einzufrosten, dann die Quellen in /var/tmp/portage/... entsprechend patchen und dann mit dem Befehl "fg 1" den Prozess weiter machen lassen. Obwohl es hier im Forum sicher einige andere Alternativen gibt.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum