Using nano as root sometimes changes permission on user's .nano_history file, causes an annoying message to appear when launching nano as user

Bug #11242 reported by Tim Hull
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nano (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

I have been having a weird problem - I have used nano as root (using sudo) to
edit some system config files.
However, somehow a .nano_history file got written with root ownership in the
user's home directory, and I get the
following message whenever I use nano as user:
Unable to open ~/.nano_history file, Permission denied
Press return to continue starting nano

This is annoying, and I've seen this problem occur in several installations.

Revision history for this message
Matt Zimmerman (mdz) wrote :

You need to use sudo -H if you are using a program which will write files to
your home directory.

Revision history for this message
Tim Hull (thully-arbornet) wrote :

This doesn't seem like an ideal situation, as users new to Ubuntu aren't going
to know what
effects the home directory and what doesn't. Also, sometimes programs make
modifications to files
in the home directory under rare circumstances.

Revision history for this message
Matt Zimmerman (mdz) wrote :

The command line is an expert interface; there are all sorts of ways to shoot
yourself in the foot. This is the way that sudo has always behaved; users
familiar with sudo will expect it, and the common case is much more convenient
this way.

Revision history for this message
Tim Hull (thully-arbornet) wrote :

I can see this in some cases, however, it seems as though some programs are
messing with
permissions inappropriately - such as the case of nano w/ its history file, and
also the case of k3b.

Revision history for this message
Peter L (randomuser72) wrote :

a I have the same problem as Tim wrote and I cant believe that this bug still exists in Ubuntu 11.10!! I found some workarounds to disable nano history, but its not solution...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.