- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Set umask for specific sftp users
Operating System - HP-UX
1821245
Members
2926
Online
109632
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2010 01:06 PM
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2010 01:21 PM
тАО07-20-2010 01:21 PM
Re: Set umask for specific sftp users
Shalom,
sftp if part of openssh respects user umask, unless overridden in sshd_config for the daemon.
It will never transfer a file as executable.
SEP
sftp if part of openssh respects user umask, unless overridden in sshd_config for the daemon.
It will never transfer a file as executable.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2010 02:59 PM
тАО07-20-2010 02:59 PM
Solution
Actually, sftpd (the remote side daemon) sets the umask value, similar to ftp. However, there appears to be a couple of useful options in sftpd. See man sshd_config. There are two options in the sshd_config file:
PermitUserEnvironment yes
SftpUmask 027
According to the sshd_config man page, if a local user's environment is permitted, then $HOME/.ssh/environment is read and the values are put in place. I could not get this to work with HP's sshd A.04.20.009. It appeared that the user environment was not implemented.
However, SftpUmask 027 in the sshd_config file did work as expected. As Steven said, the execute bit will never be set. However, the sshd directive is global -- all user files will have the sshd_config umask.
Since you have sftp working, you might consider using scp instead which is ideal for scripts. With scp, you can specify -p to preserve the mode on the remote side.
Bill Hassell, sysadmin
PermitUserEnvironment yes
SftpUmask 027
According to the sshd_config man page, if a local user's environment is permitted, then $HOME/.ssh/environment is read and the values are put in place. I could not get this to work with HP's sshd A.04.20.009. It appeared that the user environment was not implemented.
However, SftpUmask 027 in the sshd_config file did work as expected. As Steven said, the execute bit will never be set. However, the sshd directive is global -- all user files will have the sshd_config umask.
Since you have sftp working, you might consider using scp instead which is ideal for scripts. With scp, you can specify -p to preserve the mode on the remote side.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2010 07:23 AM
тАО07-21-2010 07:23 AM
Re: Set umask for specific sftp users
hi Bill
which line should I put the file environment?
which line should I put the file environment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2010 07:54 AM
тАО07-21-2010 07:54 AM
Re: Set umask for specific sftp users
The man pages say that you can put environment values in the file so what I did was:
echo "SftpUmask 027" > $HOME/.ssh/environment
This assumes that you are logged in as a user. Or replace $HOME with the location of the user's home directory. Be sure to set owner and permissions to: 600. But as I said, this had no effect. The SfpUmask did work in the sshd_config but sets umask for all sftp transfers.
Bill Hassell, sysadmin
echo "SftpUmask 027" > $HOME/.ssh/environment
This assumes that you are logged in as a user. Or replace $HOME with the location of the user's home directory. Be sure to set owner and permissions to: 600. But as I said, this had no effect. The SfpUmask did work in the sshd_config but sets umask for all sftp transfers.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP