Results 1 to 2 of 2

Thread: How to boot Linux and run script with non-root user?

  1. #1
    Join Date
    Mar 2007
    Beans
    680

    How to boot Linux and run script with non-root user?

    Hi,
    in Ubuntu 8.04 Desktop I would like on bootup process to start a script which lauaches one server. But this script should be run with user that is not root, because root doesn't have rights to start the server and I don't want to give root the privilege to start this server.

    How to bootup a Linux and run a script with non-root user?
    Thanks,
    Abcuser

  2. #2
    Join Date
    Mar 2006
    Location
    Nerderlands
    Beans
    1,349
    Distro
    Ubuntu

    Re: How to boot Linux and run script with non-root user?

    boot scripts are run as root.
    To have a script start as a normal user, you can use "su"

    as root:
    Code:
    su - user -c whoami
    this will output "user"..
    su will "pretend" your a different user. the -c option runs a command as that user. (whoami in this case, but change that to what you need)
    so you can kick off any script as root running under a different user
    "Please choose a different password, the one you have chosen is in use by UID 1432"

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
  •