Operating System - HP-UX
1820592 Members
1878 Online
109626 Solutions
New Discussion юеВ

I must use chmod for all subdirectories and files

 
SOLVED
Go to solution
cbozlagan
Regular Advisor

I must use chmod for all subdirectories and files

I must use chmod for all subdirectories and files.

Now I'm installing a software on HpUx, source CDs has many subsolders in subfolders. I must use chmod to change permission. One by one change takes much long time, I want to use only one time chmod and change all subfolders and files permission to my aimed value(777).

Is there any method to do this.

Thanks.

8 REPLIES 8
Senthil Prabu.S_1
Trusted Contributor
Solution

Re: I must use chmod for all subdirectories and files

Hi,
Chmod -R will do it for you.

From man page;

-R Recursively descends through directory arguments, set-ting the mode for each file as described above. When symbolic links are encountered, the mode of the target
file is changed, but no recursion takes place.

HTH,
Prabu.S
One man's "magic" is another man's engineering. "Supernatural" is a null word.
V. Nyga
Honored Contributor

Re: I must use chmod for all subdirectories and files

Hi,

use chmod -R for the highest directory of this software.
See also 'man chmod' for options like 'a+r' for read permissions for 'all'.

Volkmar
*** Say 'Thanks' with Kudos ***
Pete Randall
Outstanding Contributor

Re: I must use chmod for all subdirectories and files

I would suggest that alittle more analysis of your real needs be done before just blindly assigning 777 to everything. It sounds like a bit of a security problem to me.


Pete

Pete
Patrick Wallek
Honored Contributor

Re: I must use chmod for all subdirectories and files

First, a quick look at the chmod man page would have shown you the '-R' switch to make the command recursive.

Second -- Pete is correct. YOU ABSOLUTELY MUST check the permissions you are setting. Setting the permission to 777 for the files means that anyone can do anything to any of the files and directories. Somebody could easily, modify data, corrupt data, create a trojan program that does anything they want, or just delete everything.

777 are VERY BAD permissions to set on anything. You really need to rethink those permissions.
cbozlagan
Regular Advisor

Re: I must use chmod for all subdirectories and files

I do 777 setting for the folders that I put installation DVDs in them.
Patrick Wallek
Honored Contributor

Re: I must use chmod for all subdirectories and files

So you want everyone to be able to delete the copies of the DVDs? That is what can happen, you know.

If these are copies of DVDs, you would be much better off setting 555 or even 550 permissions.

Someone could theoretically substitute a hacked version of a program in one of these directories and the next time you install they could do anything from collect passwords to wipe out your entire system, especially since you generally do installs as root.

I don't care what it is, 777 is VERY BAD permissions.
Arturo Galbiati
Esteemed Contributor

Re: I must use chmod for all subdirectories and files

chmod -R 755
HTH,
Art
cbozlagan
Regular Advisor

Re: I must use chmod for all subdirectories and files

Solved