LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-20-2014, 07:17 AM   #1
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Filezilla (SFTP) sets Different Permissions compared to SSH


I have a little web space on a friends server.
It was previously some ubuntu server, but is now "Apache/2.2.22 (Debian)".
In both cases i had the problem that some files have group write permission, some don't.
files created by me.
the files created with filezilla have no group write permissions.
the files created with ssh console have group write permissions.
Code:
$ ls -al
(snip)
drwxr-xr-x  2 me   www-data  4096 Sep 20 12:56 madewithfilezilla
drwxrwxr-x  2 me   www-data  4096 Sep 20 12:47 madewithssh
i am trying hard to understand why this happens, especially since sftp seems to be using ssh, as well.

i cannot find anything relevant in ~/.ssh/config or /etc/ssh/ssh_config or "man ssh" or "man sftp".

(there is an underlying problem with ownership - something keeps changing ownership of my webroot, so i don't own the files anymore, and if i don't have group write access, i can't change them anymore. i am discussing this with the server owner, but he's not so linux-savvy.)

any ideas?
 
Old 09-20-2014, 11:27 AM   #2
nembo81
LQ Newbie
 
Registered: Sep 2014
Location: Parma,Italy
Distribution: RedHat-CentOS
Posts: 4

Rep: Reputation: Disabled
Hi there,
Have you tried to execute #chmod g+s /foldername ?
This will set the group ID for any new files created inside that folder.
Delete all test-files and retry after execute the command.

EDIT:
I found a very interesting article about permissions on sftp (maybe it's your case).
http://jeff.robbins.ws/articles/sett...p-transactions

Last edited by nembo81; 09-20-2014 at 12:15 PM.
 
Old 09-20-2014, 02:47 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872

Original Poster
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
thanks nembo81.
chmodding might help, but filezilla does not give this functionality (at least not as a default setting). i will try it, but i would hate to have to use ssh everytime i want to create a folder. my workflow has been somewhat dependent on filezilla.
btw, why did you put a slash (='/') in front of the foldername?

the article is very interesting and goes very much in the right direction.
indeed my domain's homefolder's .bashrc uses 002 as umask (probably changed at some point to countereffect the mysterious chown).
unfortunately this, too, requires server-side adjustment. which i don't have the permissions to do.

if i could tell filezilla to tell sftp to use a different umask?
 
Old 09-20-2014, 03:23 PM   #4
nembo81
LQ Newbie
 
Registered: Sep 2014
Location: Parma,Italy
Distribution: RedHat-CentOS
Posts: 4

Rep: Reputation: Disabled
Filezilla (SFTP) sets Different Permissions compared to SSH

I put the "/" in front of the folder because I thought it's the homedir of all sftp users...isn't it?
In that case with root you can set chmod g+s.
anyway,in the article there is a sample script;You can wrap filezilla start script inside that. Obviously you can do that with root user.
 
Old 09-20-2014, 03:29 PM   #5
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
By default, new files have permissions set by umask.

However, your client may apply different permissions after file creation, by default, or the sftp server might be configured to apply different permissions on new files...
 
Old 09-21-2014, 05:08 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872

Original Poster
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
@smokeyjustme, both you and the article previously mentioned talk about the sftp server.
i don't think the solution applies if i connect from my local machine, yes?

because i do not have root access to that server.
i have to wait til my friend gets back from his holiday and ask him to do something about it (in 2 weeks) - until then i'm reduced to client side & non-root solutions.
meaning: on my computer, and on my home folder on the server.

i see that in my remote home folder (on my friend's server) there's a umask set "002" in .bashrc, which, afaiu, gives new files group write permissions.
this works with ssh, but filezilla, which is set to use sftp, does not seem to use this umask.
the article suggests, to my understanding, that this indeed happens and can be changed server-side, which i understand to mean "not on my local machine".

Last edited by ondoho; 09-21-2014 at 05:15 AM.
 
Old 09-21-2014, 08:03 AM   #7
nembo81
LQ Newbie
 
Registered: Sep 2014
Location: Parma,Italy
Distribution: RedHat-CentOS
Posts: 4

Rep: Reputation: Disabled
Filezilla (SFTP) sets Different Permissions compared to SSH

exactly,the modify must be done on the server side.sftp umask setting (now is 022,he must change it to 002).
 
  


Reply

Tags
filezilla, permissions, sftp, ssh



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
CREATE_MAIL_SPOOL sets improper permissions Seilori Linux - Server 2 05-10-2013 04:29 PM
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 07:10 AM
sftp user with limited ssh permissions to autologin using publickey blazingrock4u Linux - Security 1 10-18-2010 11:52 AM
Need help configuring permissions to allow FTP access via SSH/SFTP. dhupke Linux - General 5 06-12-2007 12:26 PM
can't login remotely to SSH server using FileZilla rob_xx17 Linux - Networking 5 08-22-2006 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:28 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
Open Source Consulting | Domain Registration