Results 1 to 9 of 9

Thread: #1 Naive question: why can't I edit root-owned files?

  1. #1
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default #1 Naive question: why can't I edit root-owned files?

    OK, I understand about changing to Super User, but my system doesn't behave as I expect.

    Here's the example: I'm trying to edit smb.conf

    I can issue the command <kwrite /etc/samba/smb.conf>, get presented with a nice GUI based editor with that file open, make the changes and then click 'save'. I'm warned that save might not work, take the option to proceed and indeed save fails. No surprise: I don't have permission to write that file.

    I change to SU and issue the same command again. Now nothing happens at the command line - no GUI based edit screen is opened. The only change is in the title bar for that terminal window. It changes from <user:> bash to <user:> kwrite. I seem to be in the editor, but not in GUI mode and none of the existing file contents are displayed. The only way to exit this dialog is with <Ctrl><Shift><Q> - and this also closes my terminal session. So I can't edit the file that way.

    If I issues the command KDESU /etc/samba/smb.conf as a user, then a similar behaviour results.

    The only way I have found to edit this root-owned file is to use the KDE application launcher-->Applications-->System-->File Manager-->File Manager - Super User Mode/KDE3

    Surely there must be a more direct way than this?
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  2. #2
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Re: #1 Naive question: why can't I edit root-owned files?

    Quote Originally Posted by XEyedBear View Post
    The only way I have found to edit this root-owned file is to use the KDE application launcher-->Applications-->System-->File Manager-->File Manager - Super User Mode/KDE3

    Surely there must be a more direct way than this?
    I forgot to say that I'm using KDE 4.1, but if I don't use the KDE3 version File Manager, then I get this error message when attempting to open the file from the file manager (Dolphin) browser:

    KDEInit could not launch /usr/bin/kwrite

    Is this indicative of some sort of configuration problem?
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: #1 Naive question: why can't I edit root-owned files?

    kdesu kwrite /etc/samba/smb.conf

    should work. Just prefix any command you want to execute as root with kdesu, that's the rule.

  4. #4
    Join Date
    Jan 2008
    Location
    U.K East Anglia
    Posts
    2,581

    Default Re: #1 Naive question: why can't I edit root-owned files?

    Quote Originally Posted by XEyedBear View Post
    I forgot to say that I'm using KDE 4.1, but if I don't use the KDE3 version File Manager, then I get this error message when attempting to open the file from the file manager (Dolphin) browser:

    KDEInit could not launch /usr/bin/kwrite

    Is this indicative of some sort of configuration problem?
    This problem does exist with kde4.1. Most users got round it the way you have done via file-manager - superuser mode. Some just upgraded to kde4.3,which also solved this issue

    Andy
    To be is to do = Immanuel Kant
    To do is to be = Descartes.
    Do be do be do = Frank Sinatra

    SuSE user since 7.0,Linux user since 1994

  5. #5
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,734
    Blog Entries
    20

    Default Re: #1 Naive question: why can't I edit root-owned files?

    Quote Originally Posted by ken_yap View Post
    kdesu kwrite /etc/samba/smb.conf

    should work. Just prefix any command you want to execute as root with kdesu, that's the rule.
    Agreed. This the best method.
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  6. #6

    Default Re: #1 Naive question: why can't I edit root-owned files?

    I've just baffled my head with this been in all kinds of places so often we see xhost blah.. tried that then decided not to try it and tested. Well blow me down with a feather xclock works fine. So next started looking at kdmrc nothing I could see would cause this behaviour finally stumbled across it...
    Code:
    su -
    kwrite /the/file
    Need to use su proper to get roots env thats all.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  7. #7
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Re: #1 Naive question: why can't I edit root-owned files?

    Quote Originally Posted by ken_yap View Post
    kdesu kwrite /etc/samba/smb.conf

    should work. Just prefix any command you want to execute as root with kdesu, that's the rule.
    OK, got it. That's simple enough. Thanks.
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  8. #8
    Join Date
    Mar 2008
    Location
    Vsters, Sweden ex. Highbury London UK
    Posts
    1,245

    Default Re: #1 Naive question: why can't I edit root-owned files?

    Easy wihout the console Alt+F2 then enter kdesu kwrite /pathTo/file
    Core 2 Duo 3.16GHz, 8GB DDR2, 3.5TB, GeForce 9600 GT, Amilo LCD 26", OS 11.1 x86_64, KDE4.2.4 (2)
    My wine tips & tricks

  9. #9
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Re: #1 Naive question: why can't I edit root-owned files?

    Quote Originally Posted by geoffro View Post
    Easy wihout the console Alt+F2 then enter kdesu kwrite /pathTo/file
    Excellent! How elegantly simple.

    A lot like me really, apart from the fact that I'm not all that elegant.
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

Posting Permissions

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