scp doesn't apply umask for the files copied

This document (7010246) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 10 Service Pack 4

Situation

When trying to copy files from one server to another using SCP, the file mode is not set as expected.  The destination server has a umask set in the .bashrc file for the user being used to copy the file on the destination server, but it is being ignored.

Resolution

In testing, with a pair of servers where files are copied from a source server
to a destination server, the file mode as dictated by a umask of 0002 in the
local user's .bashrc file would copy files with a mode of 644.

In the production environment with the same configuration, the copied files
have a mode of 644 instead of 644.

This has been reported to development.

WORKAROUND: As documented in the man page, the mode will be preserved from source
 to destination with an scp copy by using the -p option.

Additional Information

This scenario was actually working in a test environment, but when it was implemented in the production environment with the same settings, it didn't work.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7010246
  • Creation Date: 02-Mar-2012
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center