-   Linux - Networking (
-   -   Blocking one pc from accessing ubuntu server (

gtrrockz84 01-25-2012 11:41 AM

Blocking one pc from accessing ubuntu server
Hi everyone,
I set up a ubuntu server (running ubuntu desktop) connected to about 15 pcs using samba. All going good for a month now. I never set up any users or groups (not sure how).

Today one of my colleague said he needs to make one of the pc's not accessible to the server.

Can anyone please help on how to do this?

Also I like to know how to setup users and groups too (im assuming this might be necessary to solve my question too?)

Thanks for your help :)

T3RM1NVT0R 01-25-2012 02:24 PM

@ Reply
Hi gtrrockz84,

I think Ubuntu firewall (ufw) can help you achieve what you are looking for. Here is the document for your reference:

I am assuming that you do not want a particular PC to access samba share on this particular server. If that is the case you can block the communication from that particular system's IP address on port 137 (UDP),138 (UDP), 139 (UDP) and 445 (tcp). If you do not want this machine to talk to your Ubuntu server at all then you can configure the UFW to reject any packet received from this machine.

For setting up samba users and groups the following links will help you out:

gtrrockz84 01-25-2012 02:52 PM

Thanks a lot for your help. So after reading the first link im thinking my command line should look like


sudo ufw deny proto tcp from
Since I want to block .045 from accessing the Ubuntu Server. Im going through the other links you sent. Thanks!

T3RM1NVT0R 01-25-2012 02:56 PM

@ Reply
I would rather suggest:

ufw deny from <ip-address-of-the-host>
as this will block any tcp/udp communication from that host.

Just to add, following link I think will be more helpful when you are dealing with ufw:

gtrrockz84 01-25-2012 03:01 PM

Oh I get it. The host being the computer I want to block. Gotchya! thanks :)

T3RM1NVT0R 01-25-2012 03:04 PM

@ Reply
You're welcome. Please mark the thread as solved if you think that the answer to your query has been provided.

Enjoy linux!!!

repo 01-25-2012 03:12 PM

You can block on IP, however, why not consider blocking on mac address?

Kind regards

All times are GMT -5. The time now is 07:28 AM.