Find the answer to your Linux question:
Results 1 to 3 of 3
guys i have a question, i made a c code and gcc -o code code.c and i want only the root to run it so i did sudo chown root ...
  1. #1
    Linux User kmitnick's Avatar
    Join Date
    May 2008
    Location
    Jordan - Amman
    Posts
    329

    [SOLVED] after compiling c file

    guys i have a question, i made a c code and gcc -o code code.c and i want only the root to run it so i did sudo chown root code && sudo chmod +s code but when i try it by any other users it runs normally so why?
    Dual Booting Ubuntu 10.04, Windows 7

    Toshiba Satellite A200-1M5, Duo Core 2.0 Ghz, 1 Gigs RAM, 256 Intel Card

    You are registered Linux user number 490788
    Happy Linuxing

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    Try these commands
    chown root:root binary_filename
    chmod 744 binary_filename
    If above two commands didn't work,then post output of
    ls -l binary_filename
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Linux User kmitnick's Avatar
    Join Date
    May 2008
    Location
    Jordan - Amman
    Posts
    329
    thnx dude ur solution was 80% working but the 100% one which worked with me was like this:

    sudo chown root:root binary_filename
    sudo chmod +s binary_filename
    thnx
    Dual Booting Ubuntu 10.04, Windows 7

    Toshiba Satellite A200-1M5, Duo Core 2.0 Ghz, 1 Gigs RAM, 256 Intel Card

    You are registered Linux user number 490788
    Happy Linuxing

Posting Permissions

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