Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have created 3 users with all the same group. I want the umask to be 0002 so that new files are 0775. I edited /etc/profile so that umask for that group would be 0775. That works when SSHed into that account, although, using FileZilla and SFTP into the account sets files at 0755 by default still.
AFAIK, sftp (in of itself) honors the user's umask. Are you sure your sftp client isn't doing some permission changes for you? Try sftp from the command line and see if it is behaving the way you would expect.
I just tried sftp using one of the accounts. It set the file to 0755. Again, I am trying to have it set to 0775. It can't be sshd, I don't think, because SSHing into the account and making a file is correct at 0775 like how I set it up in /etc/profile. Is it possible it is not reading /etc/profile when SFTPing into the account with FileZilla. I really don't think FileZilla is doing anything either.
Hmm, a sftp login doesn't appear to read /etc/bashrc either (which makes sense, since it's the startup file for a particular interactive shell).
Read the manpages for sshd(8). A snippet follows:
Quote:
LOGIN PROCESS
When a user successfully logs in, sshd does the following:
...
6. Reads the file ~/.ssh/environment, if it exists, and users are
allowed to change their environment. See the
PermitUserEnvironment option in sshd_config(5).
...
8. If ~/.ssh/rc exists, runs it; else if /etc/ssh/sshrc exists,
runs it...
You will likely need to work with that information.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.