New answers tagged

3

sshfs is using sftp under the hood and the umask for creation new files is handled by the remote sftp-server. You can set umask as an argument to the sftp-server in /etc/ssh/sshd_config on the server, such as Subsystem sftp /usr/lib/openssh/sftp-server -u 027 # Debian/Ubuntu or Subsystem sftp /usr/libexec/openssh/sftp-server -u 027 # RHEL/Fedora ...


0

Above description is very good. It provides clear description of umask and permissions. To be more pratical, If you want to see, what are permissions provided by "touch" do " strace touch /tmp/new.txt " observe the system call used by touch to create "new.txt" for ex. o/p of "strace touch /tmp/new.txt" (... -> some content) ... open("/tmp/new.txt", ...


3

The formula to calculate your file permission: default_mode & ~umask (Read the description of O_CREAT flag) Also specified by POSIX, the default mode for file is S_IROTH | S_IWOTH | S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR or 666, the default mode for directory is S_IRWXU | S_IRWXG | S_IRWXO or 777 if it was not specified by application. Since when the ...


14

umask is subtractive, not prescriptive: permission bits set in umask are removed by default from modes specified by programs, but umask can't add permission bits. touch specifies mode 666 by default (the link is to the GNU implementation, but others behave in the same way; this is specified by POSIX), so the resulting file ends up with that masked by the ...



Top 50 recent answers are included