LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 02-13-2004, 06:34 PM   #1
Harpune
Member
 
Registered: Sep 2002
Location: Seattle, WA
Distribution: Ubuntu
Posts: 101

Rep: Reputation: 15
Arrow Restricting XWindows remote connections (iptables)


My goal here is to try to prevent xwindows applications from being run by local users and displayed on remote terminals (ultimately, I want them to be able to run only through ssh, but that's not important). My best guess at preventing outgoing xwindows connections involves iptables, but for the life of me I haven't been able to set up the rules properly so that these outgoing connections are blocked.

Most of the documentations I have come across involve rules like this:
iptables -D OUTPUT -s localhost -o eth0 -p tcp --dport x11 -j DROP

I have also tried replacing the 'x11' with specific port numbers and the connections still get through.

How would I go about setting up such rules, or is there a better way to restrict the X protocol like that?

I am running slackware 9.1 with kernel 2.4.24.

Thanks
 
Old 02-14-2004, 04:03 AM   #2
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
I guess it's a typo but I mention anyway.
iptables -D OUTPUT -s localhost -o eth0 -p tcp --dport x11 -j DROP
would delete a rule it should be something like
iptables -I OUTPUT -s localhost -o eth0 -p tcp --dport x11 -j DROP
which will insert a new rule as the first rule making sure that any other rules let it through.

Other than that it seems ok.
 
Old 02-14-2004, 06:41 PM   #3
Harpune
Member
 
Registered: Sep 2002
Location: Seattle, WA
Distribution: Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 15
Whoops, my bad. I was actually try in the -A switch. maybe i'll try that one.

Thanks
 
Old 02-16-2004, 04:38 PM   #4
Harpune
Member
 
Registered: Sep 2002
Location: Seattle, WA
Distribution: Ubuntu
Posts: 101

Original Poster
Rep: Reputation: 15
Still no go. the programs still run remotely.
 
Old 02-17-2004, 06:03 AM   #5
skog
Member
 
Registered: Sep 2003
Location: TX
Distribution: slackware
Posts: 301

Rep: Reputation: 30
why dont you:

iptables -F output <-----------------------That will clear the output chain
iptables -A output -j LOG <---------------That will log everything
iptables -A output -j DROP <--------------That will drop everything so nothing can get through

and then try your programs ... then youll know how they are getting through.

add the rules you need into your original rules and your set.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting the # of SMTP Connections per IP kemplej Linux - Security 1 05-10-2005 01:35 PM
iptables: restricting forwarding?? funkymunky Linux - Security 10 03-15-2005 02:12 PM
restricting incoming connections, using sockets SoulSkorpion Programming 2 10-20-2004 03:15 AM
Restricting SFTP, SSH Remote Login majicrobot Linux - Security 1 09-20-2004 10:54 AM
restricting remote connections dominant Linux - General 0 03-03-2004 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration