You are not logged in.

#1 2014-11-12 23:15:16

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

[FIXED] File permission issues.

Hi all,

I am unable to save over files without first giving a text editor with root privileges (sudo leafpad file_name).

The permissions state that my user is the owner of these files and that the owner can view, change and access them. I am also unable to open Spotify without first giving it root privileges.

Anyone got any suggestions as to how I can fix this?

Thank you.

Last edited by Gwynplaine (2014-11-13 13:33:31)

Offline

#2 2014-11-12 23:18:26

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [FIXED] File permission issues.

What are the permissions of your home directory? Please post the output of:

ls -dl ~

Offline

#3 2014-11-12 23:20:59

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: [FIXED] File permission issues.

[aaron@ArchLinux ~]$ ls -dl ~
drwx------ 29 aaron users 4096 Nov 12 22:43 /home/aaron

Offline

#4 2014-11-12 23:25:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,658

Re: [FIXED] File permission issues.

Have you changed the umask? Default output of `umask` should be 022.

Online

#5 2014-11-12 23:29:00

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: [FIXED] File permission issues.

I haven't modified it manually (hadn't actually heard of it until just now) but here's the contents of /etc/profile.

# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

Edit:

I also entered 'umask' into the terminal which gave me '0022'. I'm not sure if the extra 0 would cause an issue?

Last edited by Gwynplaine (2014-11-12 23:31:02)

Offline

#6 2014-11-13 02:19:25

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [FIXED] File permission issues.

Alright, how about a silly little test? I'd like to learn more about the symptoms. So, you can save a new file in Leafpad but can't overwrite an existing file?

Are you using a fresh installation of Arch Linux? Did you install Arch Linux "over" an existing Linux installation?

Please post your "/etc/passwd" file.

Please post the "ls -l" output of the files you can't overwrite.

Please post the entire input and output of these commands:

cd
touch blarg.txt
ls -l blarg.txt
echo "Blarg." > blarg.txt
ls -l blarg.txt

Offline

#7 2014-11-13 12:22:16

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: [FIXED] File permission issues.

Hi there,

I was working through what you asked me to do and I noticed something.

The output of ls -l of the files that I am unable to modify stated that I didn't have modification privileges for certain files. I checked the properties through the file manager and it said that it was owned by root and that I could not modify.

The files in question are things like .bashrc, .bash_profile and the rc.lua (awesome wm). These have been copied from /etc/skel and /etc/xdg/awesome to /home/ and ~/.config/awesome/ respectively.

I haven't had much of a need to save over non-configuration files as of yet, and have been using root privileges to do so assuming that there was an issue with all files but after doing your test I could see that there was no issue with other files. I also tried to save over a few others and everything worked fine.

I would consider this issue fixed as a simple chmod fixed the files I was unable to save over. But I'm wondering, is there a way that I can automatically change a file's permission as I copy it from / to my home directory?

Offline

#8 2014-11-13 13:07:06

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: [FIXED] File permission issues.

You may not be the owner of every file/directory in your home.

sudo chown $USER -R $HOME

The command above will make your user the owner of everything in $HOME. This won't touch group permissions.
If you still have some write permission issues, you may be lacking write permissions for the owner (in this case $USER).

sudo chmod u+w -R $HOME

The above recursively sets write permissions for everything under $HOME for owner.
You can ser readand xecute permissions in a similar manner.

Offline

#9 2014-11-13 13:33:00

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: [FIXED] File permission issues.

That fixed everything.

Thank you all for your time and effort, I really appreciate it.

Offline

Board footer

Powered by FluxBB