Sudo chmod now hides directory contents [Solved]

I changed the permissions on some root subdirectories on my server that I created and now I cannot read them. The data is still there but I seem to have locked myself out. What do I do?
I have a linux server for my video and music collections, the data reside in the directories off of root /media/Movies and /media/Music respectively. I wanted to ftps some files to /Movies but I could not get in, so i sudo chmod 666 for /Movies and /Music. Now the directories are highlighted green in ls -al where before they were not highlighted and now I cannot look into the directories at the server and remotely.
How can I look into those directories for which I changed permissions?

qrp@qrp-Laptop:/media
$ ls -l
total 44

drw-rw-rw- 1 qrp qrp 4096 May 7 18:01 dellserver (highlighted green)
drw-rw-rw- 1 qrp qrp 36864 May 7 16:54 Movies (highlighted green)
drw-rw-rw- 1 qrp qrp 4096 May 7 17:45 Music (highlighted green)

$ ls -l /Movies
ls: cannot access ‘/Movies’: No such file or directory
$ cd Movies
qrp@qrp-Laptop:…/media/Movies
$ ls -l
total 0

Host: Laptop AB (same OS on the server)
OS: Zorin OS 17.1 x86_64
DE: GNOME 43.9
Kernel: Linux 6.5.0-28-generic
Shell: bash 5.1.16
WM: Mutter

I have solved my problem, I did not know that commands like ls -l require execute permission. I have changed Movies and Music to 777 and now I can see the directories and transfer files into them.
Looks like I will taking a permissions tutorial.

2 Likes

755 is adequate. You dont want anyone except the owner
having write permission

3 Likes

Ok, so first look at the directories.
You tell about /media/Movies then you ask ls -l to list /Movies, which is obviously no /media/Movies
So observe the paths!
Directories need exec permission to be able to “step in”.
777 permission says anyone can do anything with that. Are you sure, you want it that way?

2 Likes

Depends on the use case
My own directories are set to 700, so 755 would be permissive too.
The “public area” on my multi user computer is set to 770, owned by me and a group called users, so anyone being a member of the users group has full acces. Noone else.

3 Likes

777 is okay if you are the only user, right?

1 Like

Yes, but you are sacrificing protection that may be useful if you had an intruder

4 Likes