Results 1 to 2 of 2

Thread: Linux/Bash: Run a command as another user

  1. #1
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Linux/Bash: Run a command as another user

    Other than the sudo is there a way to execute a command as another user ?
    Suppose there a cluster manager running as ROOT and It accepts commands from users . All the commands have to be run using the submitted users privilege. So it there a better solution other than using the sudo command ?

    Just got the su username -c "command " .
    Any other ways ?
    We can't solve problems by using the same kind of thinking we used when we created them

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Linux/Bash: Run a command as another user

    You can use the setuid bit to run a particular command as the owner of the executable:

    # chown someuser command
    # chmod u+s command
    $ ./command
    "command" will get run with "someuser" priviledges.

Similar Threads

  1. Detecting user inaction
    By jrideout in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2010, 08:37
  2. shutting down as user
    By safknw in forum Qt Programming
    Replies: 6
    Last Post: 27th November 2006, 10:28
  3. Replies: 1
    Last Post: 24th June 2006, 12:10
  4. Discard user input events in QEventLoop.
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2006, 21:49
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 9th March 2006, 00:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.