Changing default files permission in Linux

513 Views Asked by At

I work under Centos 7.
For some time, I have a problem with the FTP /home/students directory whose access rights( permission) is set to 750. When I create a file as user students the file access permission is 644 (read/write for the owner and read-only for other users). But when the students user receives files by SFTP (with authentication by ssh key), the permission of these files is 600. Can the right of access (permission) be imposed by the one who uploads the file by SFTP?

How to make the default permission for files received by SFTP automatically 644?

Thank you

1

There are 1 best solutions below

2
Azis Sofyan Prasetyo On

I think u should do something like this > Modify /etc/ssh/sshd_config :

Subsystem sftp internal-sftp -m 0644

Then u should reload the SSHD Configuration :

sudo systemctl reload sshd