Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Linux server that has two network interfaces
eth0 has a direct connection to the internet with a static IP address
eth1 is a 192.168.x.x network to the local LAN.
I allow some external internet users shell access to the system, however, not all of them should be able to access the LAN.
I'm pretty sure iptables can now do per-user blocking, but I'm not sure what the rule would be.
For example, say that eth0 is 70.70.70.70 (for ease of use) and eth1 is 192.168.1.5 and I have three users, Fred, John and Albert. I would like Albert to be able to access anything on the 192.168.x.x network as well as the internet, and John and Fred only have access to the internet.
For example, say that eth0 is 70.70.70.70 (for ease of use) and eth1 is 192.168.1.5 and I have three users, Fred, John and Albert. I would like Albert to be able to access anything on the 192.168.x.x network as well as the internet, and John and Fred only have access to the internet.
Are John, Fred, and Albert already inside your network, or are they trying to access your network from the internet? If they're inside your network then your firewall server won't block John and Fred from accessing a server in your network. You'd have to configure ipTables on those servers to accept connections from Albert's IP address and to not accept connections from John and Fred's IP addresses. And that would work only so long as John, Fred and Albert did not change their IP address.
Or you could use something like openLDAP and PAM to force Albert, John and Fred to authenticate with the server, and then not allow John and Fred to get in once authenticated.
If they're all outside your network, then you can configure your firewall server to block all IP addresses except Albert's, but that would work only so long as Albert kept that IP address. Or you could use Radius to allow authenticated access through your firewall based on username and password, rather than IP address. You can even integrate Radius, openLDAP and PAM together so that Radius challenged users at the firewall, using the directory data in openLDAP to only let Albert, John and Fred through the firewall, and then use the pam_ldap PAM module to have the servers authenticate users against the same openLDAP directory, so that Albert is allowed access to the server but Fred and John are denied access.
I have a Linux server that has two network interfaces
eth0 has a direct connection to the internet with a static IP address
eth1 is a 192.168.x.x network to the local LAN.
I allow some external internet users shell access to the system, however, not all of them should be able to access the LAN.
I'm pretty sure iptables can now do per-user blocking, but I'm not sure what the rule would be.
For example, say that eth0 is 70.70.70.70 (for ease of use) and eth1 is 192.168.1.5 and I have three users, Fred, John and Albert. I would like Albert to be able to access anything on the 192.168.x.x network as well as the internet, and John and Fred only have access to the internet.
How would I implement that in iptables?
Thanks,
Nigel
Here's an example of how you could do it (sans context):
Code:
iptables -A OUTPUT -o eth0 -j ACCEPT
iptables -A OUTPUT -o eth1 -m owner --uid-owner Albert -j ACCEPT
iptables -A OUTPUT -o eth1 -j REJECT
That's pretty much the gist of it (let me know if you have any questions).
Are John, Fred, and Albert already inside your network, or are they trying to access your network from the internet? If they're inside your network then your firewall server won't block John and Fred from accessing a server in your network. You'd have to configure ipTables on those servers to accept connections from Albert's IP address and to not accept connections from John and Fred's IP addresses. And that would work only so long as John, Fred and Albert did not change their IP address.
They have ssh access to the server so will have a physical shell on 70.70.70.70. I would only want certain people to have access to other servers on the 192.168.x.x network. Albert, for example, would have access to any NFS mounts, Samba shares, network printers, ssh to other hosts on the internet network etc. The other users shouldn't even be able to send a ping down eth1.
Thanks, win32sux. I just gave it a try by opening up a PC's remote desktop connection. I can telnet to the port as one user but not ask the blocked user. Thanks for your help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.