Recreate the .Private link in your home directory

140 Views Asked by At

Don't ask why but I did

rm .Private 

in my home directory. It deleted the soft link /home/user/.private not the /home/.ecryptfs/user.

I did

ln -s .Private /home/.ecryptfs/yoram/.Private/home/.ecryptfs/

but I get

l?????????? ? ? ? ? ? .Private

How do I recreate the original link?

1

There are 1 best solutions below

0
Xen2050 On

Since everything still works & logs in OK, it looks like just ls doesn't have permission to execute the folder and is showing the annoying ???'s.

Giving the folder a chmod +x should fix it.

Here's some tests I did FYI:

$ mkdir test; touch test/1; touch test/2

$ ls -al test
total 0
drwxr-xr-x 2 user user  80 Dec 25 13:20 .
drwxrwxrwt 8 root root 300 Dec 25 13:20 ..
-rw-r--r-- 1 user user   0 Dec 25 13:20 1
-rw-r--r-- 1 user user   0 Dec 25 13:20 2

$ chmod -v -x test
mode of 'test' changed from 0755 (rwxr-xr-x) to 0644 (rw-r--r--)

$ ls -al test
ls: cannot access 'test/.': Permission denied
ls: cannot access 'test/..': Permission denied
ls: cannot access 'test/2': Permission denied
ls: cannot access 'test/1': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
-????????? ? ? ? ?            ? 1
-????????? ? ? ? ?            ? 2

$ chmod -v +x test
mode of 'test' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)

$ ls -al test
total 0
drwxr-xr-x 2 user user  80 Dec 25 13:20 .
drwxrwxrwt 8 root root 300 Dec 25 13:20 ..
-rw-r--r-- 1 user user   0 Dec 25 13:20 1
-rw-r--r-- 1 user user   0 Dec 25 13:20 2

$ chmod -v -r test
mode of 'test' changed from 0755 (rwxr-xr-x) to 0311 (-wx--x--x)

$ ls -al test
ls: cannot open directory 'test': Permission denied