LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2014, 02:38 AM   #1
ilesterg
Member
 
Registered: Jul 2012
Distribution: Arch, Debian, and CentOS/RHEL
Posts: 539

Rep: Reputation: 56
file permissions changed after sftp


Hi all,

I have this file with a permission of 664. After I transferred the file using
Code:
sftp user1@server
then
Code:
put file
, I tried to check the file and noticed that the file permission is already 640.

I would like to know why the file permission was changed. Is this the default umask of user1 on the other server? If so, how can we override this behavior such that the file permission of all files transferred is preserved?

Thanks!
 
Old 03-10-2014, 03:08 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

I don't use sftp (prefer rsync over ssh), but the sftp man page indicates that the -p or -P flags will preserve the permissions.

Evo2.
 
Old 03-10-2014, 03:19 AM   #3
ilesterg
Member
 
Registered: Jul 2012
Distribution: Arch, Debian, and CentOS/RHEL
Posts: 539

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by evo2 View Post
Hi,

I don't use sftp (prefer rsync over ssh), but the sftp man page indicates that the -p or -P flags will preserve the permissions.

Evo2.
Thank you very much for the suggestion. Aside from this, is there any way that this is done on the receiving end? Something like a config on the ssh setup of the remote user?

Thank again!
 
Old 03-10-2014, 03:33 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

I'm not aware of any ssh configuration that could do this. umask is the most likely, but it could also be acl.

Evo2.
 
Old 03-10-2014, 04:19 AM   #5
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 81
may be this is default umask defined for ftp.. check you configuration.
 
  


Reply

Tags
file permissions, sftp, umask


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] File permissions changed qazianeel Linux - Newbie 5 02-03-2013 11:20 AM
SMB - File copy from Windows file permissions changed? tiger.woods Red Hat 1 12-04-2012 06:18 AM
How to set file permissions using SFTP client thesignchef Linux - Server 3 04-27-2009 12:00 PM
file permissions cant be changed! shishimo Fedora 1 12-04-2004 10:23 AM
Something Changed File Permissions anthony114 Linux - Security 2 08-12-2003 08:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration