Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: openssh: Default umask for SFTP?

Subject: Re: openssh: Default umask for SFTP?
Date: Wed, 11 Oct 2006 08:40:35 -0400
On Tue, Oct 10, 2006 at 11:43:27AM -0500, Mark Holden wrote:
The issue is that when I SFTP a file onto the server, the default umask
used seems to be 077, given that files are created with mode 600 and
directories with mode 700.

This doesn't match my experience.

pegasus:~$ touch foo
pegasus:~$ ls -l foo
-rw-r--r--  1 greg  greg  0 Oct 11 08:37 foo

pegasus:~$ sftp greg@griffon
Connecting to griffon...
Enter passphrase for key '/home/greg/.ssh/id_rsa': 
sftp> cd /tmp
sftp> put foo
Uploading foo to /tmp/foo
foo                                           100%    0     0.0KB/s   00:00    
sftp> ls -l foo
-rw-r--r--    0 1000     1000            0 Oct 11 08:37 foo

Perhaps your sshd daemon is being started with a umask of 077, which is
then passed down to the sftp-server child.  Examine your start scripts,
and see whether putting "umask 022" (or whatever you wanted) in the
sshd start script helps.

<Prev in Thread] Current Thread [Next in Thread>