Change Rights

The_cobra666

Verified User
Joined
Jan 6, 2006
Messages
87
Location
Belgium
I've downloaded a file via SSH. But now I was to smart to download it from the root account. So now I can't access it from the filemanager. I've tried to chmod the file to 777 doesn't work. Does anybody know the command to change the right's of a file?
 
I'm assuming you mean the ownership of the file. If this is what you mean do the following:

# chown username:usergroup file.name

Usergroup is usually the username as well in DA world

You must do this as root from SSH
 
Jup the ownerschip :) it says root in the filemanager, but if loged in as admin, you can't even select the file :( I'll try your solution in a second :)
 
Is there a way to change all the file's rights in one folder? Cause I have like more then 1000 file's :( worked with ssh again :( wich was the only option.
 
Last edited:
Hello,

Yes there is use the following:

#chown username:username *
#chown username:username *.*

You may or may not need the second one, I cannot remember at the moment. That will change the ownership of all the files in the folder you are in. If there are any sub folders that you want the ownership changed, do the following

#chown username:username */*
#chown username:username */*.*

for each sub folder and file in the sub folder, add /* and /*.* to the above until all the ownerships are changed. (not you cannot do this:: #chown username:username */*.*/*.* or */*.*/* the *.* cannot be in the middle, it must always be at the end.
 
You've complicated it quite a bit, quackweb.

Both chmod and chown can take the -R option, which means it'll work recursively.

You don't need *.* in linux, since to linux the "." is NOT a special character.

One more thing to consider is that * will not change files that begin with the "." (which tells the shell to not show them in a directory command unless you've used -a as an option.

And you should NEVER use .* with -R as that will go up through the directory path using .. and can change the ownership and rights of your entire file system.

Be careful :) .

Jeff
 
Back
Top