How do I login as 'su into the GUI

Discussion in 'Modding and Customization' started by zarir.karbhari, Feb 23, 2009.

  1. zarir.karbhari

    zarir.karbhari

    Joined:
    Feb 23, 2009
    Messages:
    2
    Likes Received:
    0
    Hello

    I have developed an application which uses the USB port amongst other things. Currently to run this application I need to run terminal, login as 'su' and then the application otherwise it gives me a permission denied error.

    If I try to directly try to run the programme from the desktop gui by clicking on the icon of the application, it gives me permission denied error.

    How do I get this application to work from the DESKTOP Gui without running it from terminal prompt and having to login as 'su'

    Is there someway I can log into the GUI as 'su'

    How do I create users and set access privilages.

    Thanks for you help in advance.

    Karbhari
     
    zarir.karbhari, Feb 23, 2009
    #1
  2. zarir.karbhari

    ronime

    Joined:
    Nov 3, 2008
    Messages:
    486
    Likes Received:
    0
    Location:
    West Yorkshire, UK
    1. Start a shell in a terminal session. If you are using Linpus then press ALT+F2, check the "Run in terminal" box and press enter. A terminal window with a shell prompt should appear.

    2. Let's assume that your binary that needs to run with root privileges is "/root/myprog". Execute the following commands at the bash prompt:
    Code:
    sudo chown root:root /root/myprog
    sudo chmod 4755 /root/myprog
    
    The relevant concept is "setuid": http://en.wikipedia.org/wiki/Setuid
     
    ronime, Feb 23, 2009
    #2
  3. zarir.karbhari

    Japser

    Joined:
    Aug 28, 2008
    Messages:
    267
    Likes Received:
    0
    Another avenue is to make the user a member of the group that the device is in.

    For instance: audiodevices are owned by root and in the group 'audio'.
    If a user is not in the group 'audio' audio does not work ( 'permission denied' ).

    The command "groups" can be used to see the groups the user is in.

    --Japser.
     
    Japser, Feb 23, 2009
    #3
  4. zarir.karbhari

    Dalton63841

    Joined:
    Feb 8, 2009
    Messages:
    48
    Likes Received:
    0
    Logging in as root is a bad idea. If you really want to do it though, I can teach you. Fair warning though, you will find out the hard way why its a bad idea. Its always better to sudo.
     
    Dalton63841, Feb 24, 2009
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.