Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Changing File Permissions

Posted on 2004-11-24
14
Medium Priority
?
938 Views
Last Modified: 2009-07-29
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?
0
Comment
Question by:Intern
  • 7
  • 3
  • 2
  • +2
14 Comments
 
LVL 97

Expert Comment

by:Lee W, MVP
ID: 12666887
Try from a telnet or SSH session:

chmod 664 *.*

in the directory containing the files.
0
 
LVL 1

Author Comment

by:Intern
ID: 12666967
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
 
LVL 97

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 400 total points
ID: 12667001
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 1

Author Comment

by:Intern
ID: 12667102
the folder is set to 777
0
 
LVL 1

Author Comment

by:Intern
ID: 12667313
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
 
LVL 3

Accepted Solution

by:
255x4 earned 800 total points
ID: 12667324
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
 
LVL 1

Assisted Solution

by:tstoeckigt
tstoeckigt earned 400 total points
ID: 12667340
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
 
LVL 1

Author Comment

by:Intern
ID: 12667351
I am using VSFTP - or Very Secure FTP.  I will look into it.
0
 
LVL 1

Author Comment

by:Intern
ID: 12668016
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
 
LVL 1

Expert Comment

by:tstoeckigt
ID: 12668071
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
 
LVL 1

Author Comment

by:Intern
ID: 12668110
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
 
LVL 1

Author Comment

by:Intern
ID: 12668147
Figured it out.  Needed it to be 0777 for the folder
0
 
LVL 1

Expert Comment

by:tstoeckigt
ID: 12668157
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
 
LVL 1

Assisted Solution

by:tykeal
tykeal earned 400 total points
ID: 12702861
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

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question