WinSCP on SFTP Changes Owner When Editing Files - sftp

WinSCP on SFTP changes file ownership when editing files. How to prohibit changing the owner when editing a file?

Related

How to copy a file from my Windows Server 2016 to a network folder that has only write permission?

I have to move a file from my server to a network folder with only write permission.
I tried to use "net use" to map the folder, but I'm getting "The user is not allowed to log on from this workstation." Is this message related to the fact I don't have read permission? If so, how can I copy the file to the remote folder?

Customizing the nano editor in google cloud shell

I was wondering if there was a way to customize the nano editor settings in the Debian-based virtual machine instance when you launch the cloud shell.
I already tried going to the root of the instance then cd to etc and editing the nanorc file. but every time i try re-save the nanorc back it says permission denied.
Thanks.
You should be able to customize your nano editor settings by creating $HOME/.nanorc file. While Google Cloud Shell virtual machines are ephemeral (the VM is turned down when idle and a new one is allocated when you are back), the content of your home disk is persistent.

Git pull keeps the files from the wordpress upload folder?

I installed Wordpress on my server and am testing modes to automatically deploy.
The question is: When a git pull, the files in the folder uploads will be kept on the server?
The question is: When a git pull, the files in the folder uploads will be kept on the server?
It seems the /uploads/ folder is not under version control so yes it will be kept on the server.
https://github.com/WordPress/WordPress/tree/master/wp-content

Wordpress wp-content Permissions settings behaviour on different servers

I built a WP site on a particular server. I did not set or change any folder permissions and everything worked perfectly. Mainly, I could upload files and images.
I then moved the install to a different server and domain. Suddenly I could not upload to the media library.
On checking the permissions of the wp-content folder and its sub-folders the permissions were set to 755. I only assume this is what they were set to on the previous server.
By setting them to 777 I could then upload files but understand this is a big security risk. I then set it back to 755 and cannot upload again.
Can anyone explain why 755 is ok on one server but not on another please? and what I could do on the new server to make 755 acceptable?
The file permissions are correct 755, you'll have to check the file owner also.
Do not assume the file permision and owner on the development server will be correct on other servers (different os's can give issues as the one you have, different webservers from different os's can give again issues as above).
It also depends on the way you upload your files:
-you can do it throw ftp then you'll have to check the ftp settings (how it saves the files, under which user).
-if you use ssh to upload then it depends on the user that you used to connect to the server
and so on... (I saw the ftp tag but wanted to describe this also )
At this point you'll have to make sure that the website files have as owner the webserver (different server setups require different websrevers - www-data vs apache vs ... )
In the end it depends on the control (options you can change) on the server, do you have ssh access? Do you have to contact your host for this corrections?
If you are not administrating this new domain server then contact it's administrator it is a setting issue(of the ftp ) or a bug/error that he should handle.

Can write to a read-only folder

The environment is Windows 2008 R2, ASP.NET 4, IIS 7. I have a scenario where a user submits some settings to the server, and the server generates a file based on the settings (either a bitmap or an SVG file) and saves the file into a folder. The image is generated by writing a bitmap and the SVG file is generated by using File.WriteAllText. The user is then redirected to that file.
What I did not expect is that the server was able to create the file without me giving write permissions to the folder. Things I checked:
w3wp.exe is running under the IIS AppPool/MyUser, the correct app pool identity
IIS AppPool/MyUser has read permissions to the folder -- if I go to Security/Advanced/Effective Persmissions and check the permissions for MyUser on the folder, I get List Folder/Read Data, Read attributes, Read extended attributes and Read permissions
If I grab System.Security.Principal.WindowsIdentity.GetCurrent().Name right before the file is written, it's correctly set to the application pool identity.
The created file's owner is MyUser
What I don't understand is why ASP.NET can create a file in a folder to which the application pool has read-only access?
Turns out the Users group had Special permissions of Create File on the folder. Not sure why that is added by default in Windows 2008 -- on all my server boxes, new folders are created with Users having Special permissions of Create Files and some others. The behavior is different on Windows 7 -- no special permissions are added to the Users group.
Anyways, removing that permission addressed the issue.
Thanks.

Resources