unix - Set umask for a sftp account? -


could tell me how set umaskfor single sftp user? worth mentioning ibm aix...

adding umask 002 user's .profile didn't work... (the goal user files accesible people same group).

i've seen somehowto's around editing sftpd configs, though want set 1 user only, expected find didn't need root access.

thanks!

f.

the user can set without involvement of root, either client (per connection) or on server (per public key).

from client, can override remote command used handle sftp interaction using -s option:

sftp -s 'umask 0777; env path=${path}:/usr/libexec/openssh:/usr/lib/ssh:/usr/sbin sftp-server' username@hostname 

(if sftp-server not installed in 1 of locations mentioned above, add path also).

from server, can force particular command run whenever connection made using particular public key. run connections, not sftp, can inspect $ssh_original_command environment variable decide course of action take. adding following authorized_keys sufficient needs:

command="umask 0777; if [[ -n $ssh_original_command ]]; eval $ssh_original_command; else exec bash --login; fi" ssh-rsa aaaab3nzac1yc2ea... 

(substituting whichever favourite shell handle interactive logins, , noting if use tcsh you'll have modify suit shell's syntax).


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -