[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with chmod

Bret Busby wrote:
> I have created a new data partition for a Ubuntu/Debian dual boot 
> system, using gparted from the Debian 4 installation.
> Now I have to figure out how to make the new data partition accessible.
> chmod (from the Debian system) seems to be designed to frustrate.
> it used to be that using a syntax like
> chmod 777 <target>
> would make a file/directory able to be written to and read from (and executed) 
> by anyone.
> I know that is how the syntax used to be, because I remember a person (on a 
> UNIX system) losing his account, when he accidentally entered
> chmod .
> , which changed his . file permissions to zero, and not even the sysadmin could 
> save his account, so he had to be issued with a new account.

This has nothing to do with the problem, but even if all files under the
user's home had been chmod'ed to no access at all, it should be possible
to recover. Unless there is a backup, it would be hard to get the exact
permissions, but under a user's home there shouldn't be many cases where
specific permissions are needed. Adding read and write permissions to
file, and read-write-execute to directories should allow him to logon
and later fix manually other permissions, such as adding execute
permissions to scripts.

> And, I have used the numbers for permissions in Linux, when I have previously 
> had to change permissions, when FTP'ing files up to web sites.
> Now, it seems, that doesn't work anymore, and I can't figure out how to make 
> chmod work.
> I have tried using what I understand to be the required syntax from "man 
> chmod" for Debian 4, but I can't get it to work. It returns errors for 
> the syntax.
> If I use the format above, no error is returned; it just doesn't do 
> anything.
> "
> chmod 777 /data

You're changing the permissions of the directory...

> bretnewworkstation:~# ls -l /data
> total 16
> drwx------ 2 root root 16384 2009-04-02 17:34 lost+found

... but looking at the contents of the directory. To check the
permissions on /data itself, try

ls -l -d /data

To chmod what's inside the directory, you can use the -R option, but
since it's empty, there's no need to do that.

Anyway, what happens if you try to write something under /data?

I am a jelly donut.  I am a jelly donut.


Reply to: