Newly created/copied files not inheriting parent directory's permission.

Environment: ESX 3

Attempting to:  USe WinSCP382 (logged on as root) to copy files from Windows PC up to ESX host.

Issue: When copying the new files to the /vmfs/volumes/volume1 directory, the default file permissions applied to the building temp file file are: rw-r--r--.  This causes copying problems when the copy process finishes and the program tries to rename the temp file with the original's name.

What I have done:  Very little because I am new to Linux.  However, I did attempt to use WINSCP382's ability to force the proper permissions, but that does not work.  I also did logged on with a puTTY session as root, navigated to the directory in question and did the following:
1. Performed an LS -L command and saw that the directory in question is set to: rwxrwxrwx
2. Created a new file from inside the puTTY session, using ECHO "test" > TEST.  This created a new file called TEST and it still had the rw-r--r-- file permissions.

Is there a system variable that I have to change in order to force all newly created files to use the directories file permissions?
Who is Participating?
jedifennerConnect With a Mentor Author Commented:
It appears this is a known issue with using WinSCP to copy files to esx vmfs drives.  Going into the options-->programs-->transfer-->resume, disable Tranfer Resume For.  This will allow your copies to complete.
It's not the way it is in unix (well, most of it). you will have to do it by hand or use the chmod inside winscp, as far as I know.
What you need to do is set the umask on the server, which is what is read to determine new file settings.

Edit sshd_config  in /etc/ssh on the server.  Change
Subsystem   sftp    /usr/libexec/openssh/sftp-server
Subsystem sftp /opt/

Now create /opt/ and put this in it:
umask 002

And then chmod 755 /opt/

The umask subtracts from 777, so 002 will end up 775, which is what you want.
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

jedifennerAuthor Commented:
Changing them manually is not an option because it breaks my copy process.  I am no Linux guru, FAR FROM IT in fact, but I cannot believe the Linux community would make something as simple as file copying/new file creation/permissions assignment a manual task.  Just doesn't make sense!  New files should inherit the permissions from their parent directory.

Anyhow, arrkerr, I have done all that you stated with the file.  I have confirmed the sh file has the following permissions: -rwxr-xr-x.  However, I still cannot create a new file without it setting the default permissions to rw-r--r--.  Do I need to restart the box or a service?  Please indicate whether doing so will affect a running ESX 3 environment as this is a production server.

Thanks for you help!
jedifennerAuthor Commented:
This question can be closed.
Closed, 125 points refunded.
Community Support Moderator
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.

All Courses

From novice to tech pro — start learning today.