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

Posted on 2007-10-17
Last Modified: 2013-12-16
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?
Question by:jedifenner
    LVL 9

    Expert Comment

    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.
    LVL 14

    Expert Comment

    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.

    Author Comment

    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!

    Accepted Solution

    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.

    Author Comment

    This question can be closed.
    LVL 1

    Expert Comment

    Closed, 125 points refunded.
    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
    VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
    Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
    This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now