I'm working on my personal VPS configured mostly for learning sysadmin and personal projects. Have run up against an issue where my non-root user could only create/edit files in emacs by using
sudo command. This is not an issue with directory permissions since I can create files with
touch without sudo.
- Can't recall, but emacs may have been initially installed by the root user.
- User was created and added as follows:
root@hadron:~# adduser my_user
root@hadron:~# addgroup admin
root@hadron:~# adduser my_user admin
Running a command like
emacs newfile.txt would always open a blank document that couldn't be saved, and noted the following in the file path at the bottom of the terminal:
File exists: /home/my_user/.emacs.d/
Checking that .emacs.d file, the permission was as follows:
drwx------ 3 root root 4096 2012-03-26 08:07 .emacs.d
Changing the permission of the .emacs.d file to allow anyone to access it resolved the situation, but that doesn't seem like the proper solution:
chmod 777 ~/.emacs.d
drwxrwxrwx 3 root root 4096 2012-03-26 08:07 .emacs.d
What is the appropriate way of addressing this?