After transferring the file using winscp to the Linux server, you expect to have the same permission (like 777) as its parent folder but failed to get it.
$ ls -ld for-john/ drwxrwxrwx. 2 peter peter 7 Jun 27 24:09 for-john/ $ pwd /home/peter/for-john $ ls -l testing.sh ====>>transfer this file using winscp from Windows platform -rw-r--r--. 1 peter peter 5753 Jun 29 17:18 testing.sh ===>>the permission is 644 (without execution permission for user and group)
When a file is transferred from a Windows platform to RHEL, the desired permission cannot be expected if the Windows sftp client does not offer options to explicitly configure the uploaded file(s) permissions.
We must check the Windows scp/ftp client program for the issue since the source system’s (Windows) scp/ftp client informs the ssh/ftp server on the Linux system what permissions the file should have when generated.