How can I make my Linux server file permission be 4777 by Default?

How can I make my Linux server files as 4777 by default? At present it is at 455.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I assume your talking about Samba server?
whspiderAuthor Commented:
Sorry that I did not mentioned the OS it is CentOS Linux. How can we go with having file permission 4777 by default?
I need to know the context of what your talking about...

Are you accessing these files from other networked computers via NFS or Windows File Sharing? Or are you talking about users that log on to this server's terminal and do work?
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

If this is samba (i.e., windows file sharing), try adding the following to smb.conf:

create mask = 4777
force create mask = 4777

If that doesn't work, could you please explain better what you are trying to achieve?
whspiderAuthor Commented:
Well this is a web server and we run CentOS Linux. The users are web site developers and hosting customers. In windows servers it is 4777 by default. But in Linux it is usually 455. If we need to edit any file we need to give write permission. For scripts like Joomla and other is just not functioning in our server until we give the command chmod 4777 to all files through SSH. Any way we are making all the files  as 4777 so will there be any way to make all the files as 4777 by default? what ever the files we upload after this can also be taken as 4777?

How are the files uploaded? Web interface? FTP? SSH/SFTP?

In short, you need to look into the configuration of the particular service they are using to upload files and see if you can set default file permissions there.
whspiderAuthor Commented:
We upload trough all the means which you have stated. And well I would like to know where is such configuration file and which part I need to update and as what.

Julian ParkerSenior Systems AdministratorCommented:
Perhaps it's a group thing, is it faesable to add the users in question into the apache group?

Or you could try looking at umask. Note that it's a mask and not the permissions you want set. This would be added to the users .bash_profile.
   man umask

whspiderAuthor Commented:
I'm trying with that now.
I can maybe help explain the problem better:

When using a control panel such as plesk, or even manually setting up web site, you would create a user and a group for each site and the site's root folder would be owned by that user/group.

When you install joomla, which you can use to manage content (ie: upload files), it runs as the apache user.  You end up with a conflict between managing files through plesk/ftp/sftp (they get owned by the site owner) and joomla (they get owned by apache).

Probably the best idea is to add the apache user to each web site group, but you'd have to hook in to your control panel;s (ie: plesk) functionality - which I'm not sure is always possible.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.