Results 1 to 3 of 3

Thread: Difficulties when switching to root

  1. #1
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default Difficulties when switching to root

    OK I now we have "sudo", which is fine for doing one command at a time, but sometimes I need to do lots of stuff (especially when playing around with networking), so I find it handier to switch to root by doing:

    Code:
    virchanza:~$ su
    Password:
    root:/home/virchanza#
    But here's the problem. Look what happens if I try to open Kate after having switched to root:

    Code:
    root:/home/virchanza# kate &
    [1] 5924
    root:/home/virchanza# exit
    virchanza:~$ The program 'kate' is currently not installed.  You can install it by typing:
    apt-get install kate
    bash: kate: command not found
    First of all, it couldn't find Kate.

    Secondly, it mysteriously typed "exit" and switched me back to my normal user.

    So I tried it again:

    Code:
    virchanza:~$ su
    Password:
    root:/home/virchanza# kate &
    [1] 6017
    root:/home/virchanza# The program 'kate' is currently not installed.  You can install it by typing:
    apt-get install kate
    bash: kate: command not found
    
    [1]+  Exit 127                kate
    root:/home/virchanza#
    This time it didn't kick me back to my normal user, but still it failed to open Kate.

    So let's see what happens if I give it the full path to Kate:

    Code:
    root:/home/virchanza# /opt/kde3/bin/kate &
    [1] 6163
    root:/home/virchanza# No protocol specified
    kate: cannot connect to X server :0.0
    
    [1]+  Exit 1                  /opt/kde3/bin/kate
    root:/home/virchanza#
    Also let me try Kcalc:

    Code:
    root:/home/virchanza# /opt/kde3/bin/kcalc &
    [1] 6195
    root:/home/virchanza# No protocol specified
    kcalc: cannot connect to X server :0.0
    
    [1]+  Exit 1                  /opt/kde3/bin/kcalc
    root:/home/virchanza#
    It looks like there's two problems:
    1) Firstly it can't find programs like Kate and Kcalc, which I presume has something to do with the path environment variable
    2) It can't connect to the Xserver

    Anyone?
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  2. #2
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    14

    Default

    I had troubles with this on another box, just type sudo su, enter password. Worked fine for me after that.

  3. #3
    Junior Member Miland3r's Avatar
    Join Date
    Jan 2010
    Location
    /dev/random
    Posts
    28

    Default

    With Backtrack4 being Debian (Ubuntu) based do the following to get kate working in a "su -" Konsole:

    Code:
    xhost local:root
    su -
    export PATH=$PATH:/opt/kde3/bin
    export DISPLAY=:0.0
    kate

Posting Permissions

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