PDA

View Full Version : FTP server


Thoreau
26th March 2004, 11:06 PM
I followed the how-to(good job btw), but i chown'd the wrong directory... how can i "undo" that?

ghenry
26th March 2004, 11:30 PM
What directory did you change and with what command settings?

Thoreau
28th March 2004, 01:33 AM
I did chown 770 to the /home. I hit the enter key alittle before i wanted to :(

h4d
28th March 2004, 01:57 AM
your permissions for the /home directory usually should look like this:

drwxr-xr-x 10 root root 4096 Mar 22 23:02 home


To roll back what you did, do the follwing as root:

chown root.root /home
chmod 755 /home

Thoreau
28th March 2004, 08:27 PM
ah, thank you very much. Is there a man page, or a place to learn what the numbers mean?

h4d
29th March 2004, 12:56 AM
I learned about the numbers a long time ago, and was not able to quickly find a man or tutorial about it, so here it goes:

Every file on a linux partition has it's own permissions. The way it works is you assign permissions for the owner of the file, the group the owner belongs to, and the rest of the world (ie, any other user). You can set permissions to read, write and execute for each of these.

Having that in mind, let's check the permissions of the directory /home:

drwxr-xr-x 10 root root 4096 Mar 22 23:02 home
The first letter simply means it is a 'd'irectory. Then we move on to the next nine letters. Each of these are the permissions for the user (rwx), the group (r-x), and the world (r-x).

In case of this directory, you can see how the user (which is root) has permissions to 'r'ead, 'w'rite and e'x'ecute the directory. (I wonder why the system needs execute permission on a directory...this flag is more intuitive in the case of a perl script or other executables). Later you can see that the group (which is also root) has permissions to 'r'ead and e'x'ecute. Notice how the group does not have permissions to write on the file. The same permissions are set for the rest of the world in this case.

Now if you take this string of permissions (omitting the first letter) and think of it as a binary number, in which a one means the flag is set, and a 0 means the flag is not set, you would have something like this:

rwxr-xr-x -> 111101101

The idea behind the numbers you fead into the chmod command is that you convert this number to octal notation. If you follow that logic, this directory has permissions of:
USER: 111 -> 7
GOURP: 101 -> 5
WORLD: 101 -> 5
Therefore the permissions for this directory are: 755

hope it helps...

If anyone knows about why the directory has execute permissions please let me know by posting here. My fealing is that the directory needs execute permissions for any file in any subdirectory to be executable. Correct me if I'm wrong!

Thoreau
29th March 2004, 02:45 AM
oh, now it makes sense. thanks for the information, it helps alot!

Jman
29th March 2004, 06:30 AM
The relevant man page would be man chmod, the utility to change a file's access permissions. It tries to explain the numbers, but has no examples.

The execute bit on a directory affects your ability to access the contents of it. You need execute permissions to cd into a directory. Try it with a temp directory and remove the execute bit with chmod -x tempdir You won't be able to cd into it.

Marked as resolved.

h4d
29th March 2004, 07:07 AM
That makes more sense than my intuition about the execution of a directory. Thanks for clarifying that XD

Thoreau
29th March 2004, 03:24 PM
so i did
"chown root.root /home"
"chmod 755 /home"
i still have the permissions "drwx------" .

Any ideas??

(ps, i was saying thank you to the help and the information, not to the answer being solved.)

by the way i found

http://www.start-linux.com/articles/article_135.php

Thoreau
29th March 2004, 03:50 PM
I've tried using the different types described in that page, but to no avail. the permissons won't change.

Thoreau
29th March 2004, 06:18 PM
...now it's all better

Durban Manor Hotel Photos - Eunapolis-Ba Instagram Photos - Busan Travel Photos on Instagram - Condo Vipavadee parkview - Huaraz-Ancash Photos on Instagram