Page 6 of 6 FirstFirst ... 456
Results 51 to 53 of 53

Thread: HOWTO: Run a particular program but prevent it from accessing the Internet

  1. #51
    Join Date
    Aug 2006
    Location
    Canada
    Beans
    389
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Run a particular program but prevent it from accessing the Internet

    Quote Originally Posted by ochampao View Post
    I get the same problem when I try ni "myProgram" and sg no-internet "myProgram". The program starts loading and then it freezes. If I run the same program using sg myGroup "myProgram" it works. The permissions of myProgram are set like this: <lrwxrwxrwx 1 root root myProgram>.
    It's hard to tell from your description what you have done and what is happening. One thing that leaps out to me is that it appears myProgram is owned by root but you don't mention using sudo. Are you running these tests as root? If yes, did you run all the steps of the HOWTO as root too? If no, what is myGroup in your example? If myProgram does require sudo to run then that could be why things aren't working. There's probably a solution though so let me know if sudo involved.

    Another possibility is that everything is working fine and your myProgram just freezes when it does not have access to the Internet. From your description it appears it only freezes when you run it without Internet. Are you sure it's not frozen due to having no Internet?

    If you can provide more details of what you are trying to run I might be able to help more.

  2. #52
    Join Date
    Aug 2006
    Location
    Canada
    Beans
    389
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Run a particular program but prevent it from accessing the Internet

    Thanks zzarko, I just updated the HOWTO to mention your post #30 in the options section. (I had meant to do this before but then forgot)

    Also thanks Jack Brown for you post 40 about UFW, I mentioned this too since some people use that.

    All - Let me know if there is anything else I've missed in the comments that I should add to the options section.
    Last edited by amac777; February 2nd, 2012 at 01:46 AM.

  3. #53
    Join Date
    May 2010
    Beans
    3

    Re: HOWTO: Run a particular program but prevent it from accessing the Internet

    Hello and thanks a lot for the quick response.

    I have followed the HOWTO and used sudo wherever you specified using it. The program I am trying to run works without any problem if I just disable the internet connection. myGroup is the group in which my default user account belongs to, so yes it can use sudo. If I understand correctly from <lrwxrwxrwx 1 root root myProgram> "others" are allowed to read/write/execute myProgram so this shouldn't be a problem right? I have tried <sudo ni myProgram> but still no luck. Also <sg no-internet myProgram> does not work but <sg myUsername myPrgram> works. Do you think changing all the files of myProgram to myUsername:myGroup instead of root:root may help?

    Thanks again for your help

    Update: I have changed the file permissions for all the program's executables using:

    Code:
    sudo chmod -R a+rwx myProgram/
    and now the script works fine. Initially the executables had the permissions:

    Code:
    drwxr-xr-x 7 root root [...] myProgram
    It seems the fact that "others" had only execute privileges did not allow the 'ni' script to work properly.

    To verify which applications access the internet I have used:

    Code:
    lsof -i -n -P
    Last edited by ochampao; February 19th, 2012 at 12:45 PM.

Page 6 of 6 FirstFirst ... 456

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •