- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: my umask doesnt work when doing scp
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
Discussions
Discussions
Forums
Forums
Discussions
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
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-25-2010 06:12 AM
тАО06-25-2010 06:12 AM
my umask doesnt work when doing scp
i have already tried numerous workaround like:
http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions
http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_umask.html
here is the example
Source
[ajhingan@station1 ajhingan]$ umask
0027
[ajhingan@station1 ajhingan]$ ls тАУltr abc
-rw-r----- 1 ajhingan ajhingan 0 Jun 25 07:13 abc
Destination
[ajhingan@station2 ~]$ scp ajhingan@station1:/home/ajhingan/abc .
[ajhingan@station2 ~]$ umask
0002
[ajhingan@station2 ~]$ ls -ltr
total 0
-rw-r----- 1 ajhingan ajhingan 0 Jun 25 07:14 abc
Any help will really be greatly appreciable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2010 08:15 AM
тАО06-25-2010 08:15 AM
Re: my umask doesnt work when doing scp
You could try something like:
ssh ajhingan@station1 dd if=/home/ajhingan/abc | dd of=abc
This will copy the file to the local host and the umask will be applied to the file permissions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2010 09:20 AM
тАО06-25-2010 09:20 AM
Re: my umask doesnt work when doing scp
scp -p ajhingan@station1:/home/ajhingan/abc .
it should perserve the permission set on station1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2010 07:03 PM
тАО06-25-2010 07:03 PM
Re: my umask doesnt work when doing scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2010 03:22 AM
тАО06-27-2010 03:22 AM
Re: my umask doesnt work when doing scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2010 06:21 AM
тАО06-27-2010 06:21 AM
Re: my umask doesnt work when doing scp
sftpfilecontrol (http://sftpfilecontrol.sourceforge.net/) to manage the
umask on a per-user basis. However, I can't get it to work too
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2010 09:28 AM
тАО06-27-2010 09:28 AM
Re: my umask doesnt work when doing scp
Not a useful description of what you did.
> [...] I can't get it to work too
Not a useful description of what happened
when you did it.
Did you notice that "scp" and "sftp" are
spelled differently?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2010 03:46 AM
тАО06-28-2010 03:46 AM
Re: my umask doesnt work when doing scp
I integrated a sftpfilecontrol patch v1.3 with my openssh 5.1p1 and build an rpm for that. I can now see my sshd_config file is showing me the Umask changed option.
[root@station1 SPECS]# nc localhost 22
SSH-2.0-OpenSSH_5.1p1+sftpfilecontrol-v1.3
[root@station1 ~]# cat /etc/ssh/sshd_config | grep -i sftp
SftpUmask 0002
Subsystem sftp /usr/libexec/openssh/sftp-server
[root@station1 ~]# uname -i
i386
[root@station1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
However i am still confused if whatever i did was to make the changes for just SFTp and not SCP? Are sftp and scp work differently? If yes then what patch should i imply for the changing UMASk for scp transactions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2010 05:11 AM
тАО06-28-2010 05:11 AM
Re: my umask doesnt work when doing scp
> [...]
They're spelled differently for a reason.
> [...] If yes then what patch should i imply
> [...]
I have no idea. I didn't even know about the
patch for SFTP.
Have you considered using SFTP instead of
SCP?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2010 03:35 AM
тАО06-29-2010 03:35 AM