- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scp does not create correct permissions
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
06-10-2009 11:34 AM
06-10-2009 11:34 AM
When a filed is scp'ed, it has 600 permissions. when the same account does a 'touch' on the file, it has correct permissions of 751. What's going on?
This is on 11.23, Itanium machine.
the source machine has correct permissions on the file.
FWIW, the box has been recently converted to a trusted host.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 11:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 11:41 AM
06-10-2009 11:41 AM
Re: scp does not create correct permissions
Adding the '-p' switch to 'scp' will preserve the modification and last-access timestamps along with a file's modes.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 12:57 PM
06-10-2009 12:57 PM
Re: scp does not create correct permissions
When you run scp, it performs a "non-interactive login" to the remote host. Most shells will skip large parts of the session startup procedure if the session is not interactive... for example, the shell might not run /etc/profile at all. In this case, the umask of the remote end might be determined only by kernel/sshd defaults, and thus be different from the usual value.
Most likely James's suggestion to use the "-p" option will help. If not, you may have to do some reading.
If you're pushing the file to a remote host, find out which shell the destination account is using at the remote host, then read the man page of that shell. Pay special attention to chapters titled like "STARTUP", "INVOCATION" etc.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 02:04 PM
06-10-2009 02:04 PM
Re: scp does not create correct permissions
In general, as with nearly all programs, what
scp does or does not do may depend on what
you tell it to do. And if you've disclosed
that, I must have missed it.
> What's going on?
You first.
> This is on 11.23, Itanium machine.
_What_ is? The client or the server? The
source or the destination? And what's at
the other end?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 02:07 PM
06-10-2009 02:07 PM
Re: scp does not create correct permissions
umask can be over-ridden in the sshd_config or the ssh_config file
touch works off the user profile.
scp is like ftp, and does not read the full user profile.
SEP
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
06-10-2009 02:08 PM
06-10-2009 02:08 PM
Re: scp does not create correct permissions
No matter what the umask, scp or sftp will not give 7 permissions on a file.
That is because doing so creates a massive security hazard.
SEP
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
06-10-2009 03:41 PM
06-10-2009 03:41 PM
Re: scp does not create correct permissions
Like it or worked !! Click kudos !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 07:34 PM
06-10-2009 07:34 PM
Re: scp does not create correct permissions
I don't see how? touch(1) should only start with 666. It could only be 640 and not have the "x" bits. And I assume umask is 26.
$ typeset -i8 x=0
$ (( x = 8#751 & ~8#111 )); echo $x
8#640
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2009 08:25 PM
06-10-2009 08:25 PM
Re: scp does not create correct permissions
scp mostly used the sshd_config file and when you login that time .profile is used
check you sshd_config file is there umask is set or not.
Suraj