Changing File Permissions

I am using a user 'FTP' to ftp files to my Redhat box.  These files that get ftp'd come across with RW-R-R properties.  What I need to know is how can I automatically grant write priviliges to the group?

The 'FTP' user will put the files on the system, but the Oracle Database needs to be able to delete those files.  So the user 'ORACLE' and 'FTP' are in the same group, but 'ORACLE' can not delete the file because of the permissions on the file.

Is there anyway to change this?
LVL 1
InternAsked:
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.

Lee W, MVPTechnology and Business Process AdvisorCommented:
Try from a telnet or SSH session:

chmod 664 *.*

in the directory containing the files.
0
InternAuthor Commented:
The problem is that we are FTP'ing from an VMS system and chmod is not a recognized command.  I really need to be able to change the permissions right after the file is moved over.  Is there a way to change the default settings for files that get ftp'd to the server?

So that everyfile that oracleftp sends it is open to everyone?
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
I believe it's based on the destination folder's permissions.  Change them via SSH or telnet on the destination system so that the folder you are FTPing to is set 775.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

InternAuthor Commented:
the folder is set to 777
0
InternAuthor Commented:
Can I create a job in linux that runs every 30 seconds that would run as the user 'FTP' in the /home/ftp directory that would do a

chmod 777 *.dat
0
255x4Commented:
Intern,

The problem is most likely with the UMASK that is in the FTP setup.

The folder is set to 777, meaning that any user many access, view, and modify the contents of the directory.  That means, the ORACLE user account can change the permissions on files after they have been FTPed, but the file need to be pre-set to writable by the group by default.  This means that the default UMASK setup in the FTP program needs to be either either x5y or x7y, with x being whatever permission you want the owner of the file to have (in this case the user ftp) and y being the permissions for EVERYONE to have to the file.  It might be best to set permissions to x55 or x77, but you would have to BE SURE that ANONYMOUS login is disabled on the FTP program.

So, now to the important question, which FTP server are you using on the RedHat machine, and was it installed by default or did you install it by hand?

Thanks,

255x4
0

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
tstoeckigtCommented:
I'm not sure if it will help something, but are you allowed to change the umask of your ftp-server?
Normally it is 0022 which means, that the writing flags from group and other are removed (from default mask 0666).
If you can change your umask to 0002 the ftp-client should create the files with the mask 0664, shouldn't it?

Ciao
Timo
0
InternAuthor Commented:
I am using VSFTP - or Very Secure FTP.  I will look into it.
0
InternAuthor Commented:
How can you delete a file if you are not the owner of that file???  How can 'ORACLE' delete a file owned by 'FTP'?

I changed the permissions on the file to 777 but ORACLE still can not delete the file.
0
tstoeckigtCommented:
At first, you don't have to set the permissions to 0777. It's enough to set them to 0666 because you probably don't want them to execute, do you?
What permissions has the directory from which you want to delete files? If ORACLE doesn't have write permissions this user won't be able to delete because he can't change the contents of the directory.
Just call chmod g+w DIRECTORY. Than try to delete the file with the ORACLE-user.

Ciao
Timo
0
InternAuthor Commented:
The directory is set to 7777, I really don't care if people can execute them, I just want to be able to delete the files
0
InternAuthor Commented:
Figured it out.  Needed it to be 0777 for the folder
0
tstoeckigtCommented:
That's what I meant. But it's enough to be 0770 because you probably don't want the rest of the world to delete/access your file.

Ciao
Timo
0
tykealCommented:
There's another option.

Put create a new group for both FTP and ORACLE to be part of.  Let's call it SHARED for now ;)

On the directory that FTP is putting files into change the ownership and permissions to be as follows:

As root:
chown -R .SHARED <the directory>

Please not the dot preceding SHARED.  This will change the group ownership of the directory.  Now change the permissions on the directory as follows:

chmod 2770 <the directory>

What this will do is set the group sticky bit so that any file dropped into that directory is forced into group ownership SHARED and still owned by whomever dropped the file in there.  Now just make sure that the umask is 0002 for both accounts.  With the correct permissions in place just the appropriate accounts will be able to access and modify the files.
0
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
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.