Ask Your Question

Fedora 21 Permission denied on symbolic link to my own file

asked 2015-01-13 04:26:10 -0500

Numkil gravatar image

updated 2015-01-13 14:43:22 -0500

I'm doing the following steps

git clone blabla
cd ~/blabla
ln -s testfile ~/testfile

Now whenever I want to acces the testfile via the symbolic link I get permission denied. I'm 100% sure I did the same steps on previous installations of fedora to get this file running. Why is it not working this time?

I did some more research. Even if I just do

echo "testtestest" >> In any random directory from my user then make a symbolic link to it, I will have a permission denied when I try to access the file through the link.

Is this a bug or am I really missing something crucial here?

I'm really baffled by this. I hope some1 can help me out.

edit retag flag offensive close merge delete


Shouldn't that last step be:

ln -s testfile ~/testfile
cobra gravatar imagecobra ( 2015-01-13 05:05:21 -0500 )edit

Yes sorry that was a typo

Also chmod 777 as ugly as it is doesn't work, I'm the owner but I also tried chowning it again nothing works.

I can copy it perfectly fine and then it works but I'd still like the symbolic link to be there

Numkil gravatar imageNumkil ( 2015-01-13 05:10:13 -0500 )edit

How are you accessing the file? and what does it do? can we clone the same git repo to try?

randomuser gravatar imagerandomuser ( 2015-01-13 08:28:39 -0500 )edit

The repo is The file I'm trying to symbolic link is my vimrc.

If I copy the file I seem to have full rights to it and can do whatever I want with it. When I make a symbolic link I can't even open it via the link. I'm just cloning to my documents folder so I'm not doing anything crazy like trying to download it to some system folder.

Numkil gravatar imageNumkil ( 2015-01-13 08:47:45 -0500 )edit

Ahh, I see. It doesn't answer the question directly, but you might enjoy using vcsh.

randomuser gravatar imagerandomuser ( 2015-01-13 08:51:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-13 17:06:04 -0500

sinic gravatar image

updated 2015-01-14 17:13:42 -0500

A symbolic link is relative to its parent directory, not to the current working directory at the time of its creation. ln -s testfile ~/testfile will thus create a link ~/testfile that references itself. Most programs will fail with the descriptive error message Too many levels of symbolic links when you try to open it, but Vim confusingly reports [Permission Denied] for a variety of error conditions.

Either create an absolute (ln -s ~/blabla/testfile ~/testfile) or a correct relative link (ln -s blabla/testfile ~/testfile).

edit flag offensive delete link more

Question Tools


Asked: 2015-01-13 04:26:10 -0500

Seen: 2,170 times

Last updated: Jan 14 '15