Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Using sudo nano may create a root owned folder in user Home folder (.nano

  1. #1
    Join Date
    Jun 2007
    Beans
    14,464

    Using sudo nano may create a root owned folder in user Home folder (.nano

    Of no real significance I guess though don't like root owning anything in my $HOME
    (- wouldn't know what source to bug..

    Edit: turns out the 1st run of nano creates the folder, if done as root then root owns, otherwise it's a user owned dir. of no particular use.
    Last edited by mc4man; July 7th, 2015 at 01:33 AM. Reason: thread title

  2. #2
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: sudo nano creates a root owned folder in user Home folder (.nano

    We normally post sudo for editing system files.

    But if a file in /home, you then should not need sudo.
    For info on UEFI boot install & repair - Updated Mar 2015:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  3. #3
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: sudo nano creates a root owned folder in user Home folder (.nano

    What is in that root owned folder, or is it empty?
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  4. #4
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 15.04 Vivid Vervet

    Re: sudo nano creates a root owned folder in user Home folder (.nano

    Yes, I can confirm this.

    Code:
    sudo nano /etc/hosts
    I added a dummy line starting with #, ctrl-o to save, ctrl-x, and folder ~/.nano appeared owned by root. It's empty.
    Ubuntu 15.04 Desktop Guide - Ubuntu 14.04 Desktop Guide - Forum Guide to BBCode - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  5. #5
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Using sudo nano creates a root owned folder in user Home folder (.nano

    I can also confirm this is happening in my 15.10 as well. It is possible to avoid it, not surprisingly, by using sudo -i nano or sudo H nano but it would be good to know why this root-owned folder appears with sudo nano.

    You do not even need to open a file for the folder to appear; simply using sudo nano to open nano empty as root does this.

    PaulW2U from these forums has raised a launchpad bug for this
    https://bugs.launchpad.net/ubuntu/+s...o/+bug/1471459 but has then suggested it is an invalid bug as it does not occur if he uses sudo nano to open a system file.

    That is not my finding where any use of sudo nano makes that .nano folder in my home
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  6. #6
    Join Date
    May 2010
    Location
    South Gloucestershire, UK
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Using sudo nano creates a root owned folder in user Home folder (.nano

    Thanks ajgreeny, I'm not sure what planet I was testing on previously.

    Anyway, I've re-opened the bug - https://bugs.launchpad.net/bugs/1471459 - and marked it 'Confirmed' as there are currently two of us shown as being affected.
    I'm part of a small team that produce the Ubuntu Weekly Newsletter. We always need help, especially at weekends. Want to join us?

  7. #7
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Using sudo nano creates a root owned folder in user Home folder (.nano

    And now a third, v3.xx, so it is certainly still there as a bug!
    DISTRO: Xubuntu 14.04-64bit --- Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  8. #8
    Join Date
    Jun 2007
    Beans
    14,464

    Re: Using sudo nano creates a root owned folder in user Home folder (.nano

    Typically the first time in an install I’d use nano would be as root, so decided to check otherwise.
    Seems now the first use of nano creates the .nano folder. So if done as a user then it will be created & subsequent uses of 'sudo nano' will leave alone & not change permissions.

  9. #9
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: sudo nano creates a root owned folder in user Home folder (.nano

    Quote Originally Posted by coffeecat View Post
    Yes, I can confirm this.

    Code:
    sudo nano /etc/hosts
    I added a dummy line starting with #, ctrl-o to save, ctrl-x, and folder ~/.nano appeared owned by root. It's empty.
    Since I never used 'nano', I just tried using 'vi', and no root file is left over on my home folder.

    edit: is it a 'nano' problem then?

  10. #10
    Join Date
    Jul 2014
    Beans
    812
    Distro
    Ubuntu Mate

    Re: sudo nano creates a root owned folder in user Home folder (.nano

    Quote Originally Posted by VMC View Post
    Since I never used 'nano', I just tried using 'vi', and no root file is left over on my home folder.
    edit: is it a 'nano' problem then?
    It looks so. You could try "sudo nano" and see if you are affected and maybe add your findings to the launchpad bug report.

Page 1 of 2 12 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
  •