Page 5 of 9 FirstFirst ... 34567 ... LastLast
Results 41 to 50 of 88

Thread: HOWTO: Easily open any file as root via drag & drop

  1. #41
    Join Date
    Jun 2005
    Location
    Coin, Spain
    Beans
    187

    Re: HOWTO: Easily open any file as root via drag & drop

    Anybody any idea why this script should not work in Debian? I have faithfully created the script and it has put an "open as root" option on right click but it doesn't do anything?

    Thanks from an ubuntu user who has moved on to debian but still comes back for old times sake

    TIA!

  2. #42
    Join Date
    Apr 2005
    Beans
    20

    Re: HOWTO: Easily open any file as root via drag & drop

    In my Debian Sarge:

    gksu "gedit %u"

    http://www.ubuntuforums.org/misc.php...=0&forumid=58#

  3. #43
    Join Date
    Aug 2005
    Beans
    65

    Re: HOWTO: Easily open any file as root via drag & drop

    For KDE users, one trick I use is to use the fish protocol with kate to edit files as root. To do this you need:
    1. to set up a password for your root account (I don't know if this is the best/only way to do this, or what the security implications are):
    % sudo -i
    # passwd
    2. install openssh
    apt-get install openssh-client openssh-server
    3. in kate, when you want to open a file as root, "loopback" to your current machine using fish. In the location bar, type fish://root@host (<-- substitute the name of your host)
    You'll be prompted to log in as root, and then be able to browse your filesystem and edit/save files as root.
    BTW, fish is a secure protocol for transparently accessing files on remote systems over ssh. It works very nicely. Just use the uri above with the name of the host you want to access (e.g., fish://yourlogin@remotehost). In this way you can securely read/edit/write files over the network with tools like kate and konqueror.

  4. #44
    Join Date
    Oct 2004
    Beans
    80

    Re: HOWTO: Easily open any file as root via drag & drop

    Sweet script. But I also like being able to open as root the folder I'm already in, and not have to go up one folder, then select the folder and run the script. I already had a script that did this (and only this; didn't open files as root). So I combined the two. Here's the result:
    Code:
    #!/bin/sh
    ### openas-root:
    ###   nautilus script for opening the selected files as superuser (uid=0),
    ###   utilizing the appropriate applications.
    
    if [ -n "$1" ]; then
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
            gnome-sudo "gnome-open $uri" &
    done
    else
    gnome-sudo "nautilus --no-desktop $NAUTILUS_SCRIPT_CURRENT_URI"
    fi
    ### end of file.
    If you have a file (or files) selected it opens it (them) with root. If no file is selected it opens the working directory with Nautilus as root.

  5. #45
    Join Date
    Jan 2006
    Location
    Australia
    Beans
    152
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Easily open any file as root via drag & drop

    Great tutorial. Thank you!
    hen3rz
    Registered Linux user #407548

  6. #46
    Join Date
    May 2006
    Beans
    479

    Re: HOWTO: Easily open any file as root via drag & drop

    ~/.gnome2/nautilus-scripts/

    Where is this ~ directory i can't find it anywhere ?

  7. #47
    Join Date
    Oct 2004
    Beans
    80

    Re: HOWTO: Easily open any file as root via drag & drop

    Quote Originally Posted by mech7 View Post
    ~/.gnome2/nautilus-scripts/

    Where is this ~ directory i can't find it anywhere ?
    Whenever you see a '~/' it means in your home directory, just replace '~/' with '/home/"you"/. In this case '/home/"you"/.gnome2/nautilus-scripts'

  8. #48
    Join Date
    Aug 2006
    Location
    Belgium
    Beans
    12

    Cool Re: HOWTO: Easily open any file as root via drag & drop

    Quote Originally Posted by kanem View Post
    Sweet script. But I also like being able to open as root the folder I'm already in, and not have to go up one folder, then select the folder and run the script. I already had a script that did this (and only this; didn't open files as root). So I combined the two. Here's the result:
    Code:
    #!/bin/sh
    ### openas-root:
    ###   nautilus script for opening the selected files as superuser (uid=0),
    ###   utilizing the appropriate applications.
    
    if [ -n "$1" ]; then
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
            gnome-sudo "gnome-open $uri" &
    done
    else
    gnome-sudo "nautilus --no-desktop $NAUTILUS_SCRIPT_CURRENT_URI"
    fi
    ### end of file.
    If you have a file (or files) selected it opens it (them) with root. If no file is selected it opens the working directory with Nautilus as root.
    Hi Kanem,

    I'm new on Ubuntu (Linux), I did al what I have to do but when a right-clik on a file or folder and choose Scripts >> Open as Root nothing happens! I'm really confused.

    I'm trying to change my "xorg.conf" file, need to that 'cause I have 2 monitors on my PC.

    It's seems to be very cool but won't work for me, I guess ...

    Thanks in advance guys

  9. #49
    Join Date
    Jun 2006
    Beans
    4

    Re: HOWTO: Easily open any file as root via drag & drop

    Here is what I do for KDE. Right click on panel, choose Add Non-KDE Application, the title and description can be anything that you like. In the Command line arguments window type
    Code:
    kdesu konqueror
    This will prompt you for the root password and then open Konqueror as root.

    Quote Originally Posted by connellr View Post
    Thanks for your sugestion, but this doesn't seem to work in kde ... First of all I dont think kde-sudo and kde-open exist (on my computer anyhow). I tried modifying your script to use gksudo and gnome-open (gnome-open seems to work in KDE as well) but I couldn't find anywhere to put the script where it would work on the right-click menu. Anyone else have any ideas?

  10. #50
    Join Date
    Jun 2006
    Beans
    4

    Re: HOWTO: Easily open any file as root via drag & drop

    Here is what I do for KDE. Right click on panel, choose Add Non-KDE Application, the title and description can be anything that you like. In the Command line arguments window type
    Code:
    kdesu konqueror
    This will prompt you for the root password and then open Konqueror as root.

    Quote Originally Posted by connellr View Post
    Thanks for your sugestion, but this doesn't seem to work in kde ... First of all I dont think kde-sudo and kde-open exist (on my computer anyhow). I tried modifying your script to use gksudo and gnome-open (gnome-open seems to work in KDE as well) but I couldn't find anywhere to put the script where it would work on the right-click menu. Anyone else have any ideas?

Page 5 of 9 FirstFirst ... 34567 ... LastLast

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
  •