Results 1 to 8 of 8

Thread: sudo does not open applications

  1. #1
    mararie NNTP User

    Default sudo does not open applications

    Hi, I'm quite a newbie. I encounter a problem when I want to connect to the internet. For this, I use

    sudo NetworkManager

    The problem is that I cannot open any applications anymore after having used the sudo command (so I also need to open the browser before connecting to the internet).
    The error I get is:

    Invalid MIT-MAGIC-COOKIE-1 keyError: cannot open display: :0.0

    I have no clue why I suddenly have this problem, since it worked fine for a couple of days. Can anybody help?

  2. #2
    Join Date
    Sep 2008
    Location
    Slovenia
    Posts
    335

    Default Re: sudo does not open applications

    I've never used NetworkManager, but supposing it must be run with rooot privileges, in konsole type
    Code:
    su -
    enter password for root user and hit enter, then enter
    Code:
    NetworkManager
    . After this try to open other applications like browser as normal user. I'm not sure it'll work, but it's worth trying.

  3. #3
    ajp NNTP User

    Default Re: sudo does not open applications

    arcull wrote:

    >
    > I've never used NetworkManager, but supposing it must be run with rooot
    > privileges, in konsole type
    > Code:
    > --------------------
    > su -
    > --------------------
    > enter password for root user and hit enter, then enter
    > Code:
    > --------------------
    > NetworkManager
    > --------------------
    > . After this try to open other applications like browser as normal user.
    > I'm not sure it'll work, but it's worth trying.
    >
    >


    WARNING su - will leave you logged in as root. Just do the (very few things
    you need to do such as NetworkManager) and then exit/Ctrl-D back to being a
    normal user - the bash prompt should tell you who you are - if in any doubt
    log all the way out and back in again. You definitely don't want to do
    things like browse the internet as root :-)

    Alan

    --
    email =~ s/nospam/fudokai/

  4. #4
    Kevin Miller NNTP User

    Default Re: sudo does not open applications

    ajp wrote:
    > WARNING su - will leave you logged in as root. Just do the (very few things
    > you need to do such as NetworkManager) and then exit/Ctrl-D back to being a
    > normal user - the bash prompt should tell you who you are - if in any doubt
    > log all the way out and back in again. You definitely don't want to do
    > things like browse the internet as root :-)


    One doesn't normally browse the internet via a bash shell. If you start
    Firefox (or another browser) from the CLI while root, you would be, but
    most likely one would just click on the icon on the desktop or menu
    which would start the browser as a normal user. It neither knows nor
    cares that there is a terminal open as root...

    ....Kevin
    --
    Kevin Miller
    Juneau, Alaska
    http://www.alaska.net/~atftb

  5. #5

    Default Re: sudo does not open applications

    If you're using the kde desktop instead of trying to use sudo use: kdesu

    Should ask for the root password and run the command when successfully entered

    When you use kdesu you're only root for that particular command whereas using su means you stay as root until you end the session

    There's probably a gnome equivalent if that's the desktop you use but I don't know it


    You can also make a menu shortcut run a program as root instead of your user as I've done with gparted

    Right-click the shortcut and click Edit Item, look for a 'Run as different user' box, tick the checkbox and enter root as the value in the text box, hit File, Save

    Next time you click the icon you should be asked for the root password

  6. #6
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,985

    Default Re: sudo does not open applications

    But why browse as root? This never happened in all suse installs I've seen, sounds very unsecure. There's something wrong here the OP should try to fix first. Maybe it's just a question of adding oneself to the appropriate group?

    I'd recommend the OP to post again in the Network/Internet forum, this is Applications. People more knowledgeable than me will solve this easily.

  7. #7
    mararie NNTP User

    Default Re: sudo does not open applications

    thank you all for your answers! it now works when i use the command xhost + before opening networkmanager, but this is probably not the best solution.
    thanks brunomcl for the suggestion to post this on the network/internet forum, i'll try that forum too.

  8. #8

    Default Re: sudo does not open applications

    Quote Originally Posted by Ecky View Post
    There's probably a gnome equivalent if that's the desktop you use but I don't know it
    ...
    gksudo or gnomesu depending on distro / what you have installed, I believe...

Tags for this Thread

Posting Permissions

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