Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
<SLOVED> SSH + chmod
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Sephiroth81
n00b
n00b


Joined: 24 Jan 2005
Posts: 52

PostPosted: Wed Dec 07, 2005 6:34 pm    Post subject: <SLOVED> SSH + chmod Reply with quote

Hi. There ara users who connect to my server via ssh using FileZilla. They often copy some files to server. The directory where those files are copied is shared in local network. The problem is that users cannot delete those files, because after copying those files rights are set to 644. How can I set it, so the files rights are automticaly set to 777(for example).

Last edited by Sephiroth81 on Wed Jan 04, 2006 12:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
Voorhees51
Guru
Guru


Joined: 05 Nov 2003
Posts: 358

PostPosted: Wed Dec 07, 2005 7:27 pm    Post subject: Reply with quote

what FTP server are you running, and possibly post your config so that we can have more info to help you with
Back to top
View user's profile Send private message
Sephiroth81
n00b
n00b


Joined: 24 Jan 2005
Posts: 52

PostPosted: Wed Dec 07, 2005 10:08 pm    Post subject: Reply with quote

All users connect to sshd deamon using sftp. What files should I post ? I use rssh to chroot them into one specific directory
Back to top
View user's profile Send private message
Voorhees51
Guru
Guru


Joined: 05 Nov 2003
Posts: 358

PostPosted: Thu Dec 08, 2005 5:30 am    Post subject: Reply with quote

a simple fix is to write a script that runs that will chmod all the file permissions of the files in the directory to what you want them to be.
I'm not exactly sure how to default set permissions for sftp to use though.
Back to top
View user's profile Send private message
Sephiroth81
n00b
n00b


Joined: 24 Jan 2005
Posts: 52

PostPosted: Tue Jan 03, 2006 9:17 am    Post subject: Reply with quote

Could any of You write down such a script?
Back to top
View user's profile Send private message
frenkel
Veteran
Veteran


Joined: 13 May 2003
Posts: 1034
Location: .nl

PostPosted: Tue Jan 03, 2006 9:36 am    Post subject: Reply with quote

Sephiroth81 wrote:
Could any of You write down such a script?

If that directory is mounted on a seperate drive, you could set umask for it. IIRC umask sets default permissions for files created on that drive.
Back to top
View user's profile Send private message
Sephiroth81
n00b
n00b


Joined: 24 Jan 2005
Posts: 52

PostPosted: Tue Jan 03, 2006 9:56 am    Post subject: Reply with quote

This directory is on separate partition and it's mounted to /home/files.
So how can I set those default permissions ??
Back to top
View user's profile Send private message
frenkel
Veteran
Veteran


Joined: 13 May 2003
Posts: 1034
Location: .nl

PostPosted: Tue Jan 03, 2006 10:27 am    Post subject: Reply with quote

Sephiroth81 wrote:
This directory is on separate partition and it's mounted to /home/files.
So how can I set those default permissions ??

In your fstab, something like this will work I think:

Quote:

/dev/hda7 /mnt/files xfs logbufs=8,noatime,umask=0000


This will make al files created have the default permission 0666.

Also see

$ man umask

Good luck!
Back to top
View user's profile Send private message
Sephiroth81
n00b
n00b


Joined: 24 Jan 2005
Posts: 52

PostPosted: Wed Jan 04, 2006 11:17 am    Post subject: Reply with quote

It does not work :-(
I also tried to use cron to chmod all files in this folder. I added this to crontab :
Code:

1  *  * * * /bin/chmod -R 666 /home/dokumenty/

but it also does not work :-(
Back to top
View user's profile Send private message
frenkel
Veteran
Veteran


Joined: 13 May 2003
Posts: 1034
Location: .nl

PostPosted: Wed Jan 04, 2006 11:57 am    Post subject: Reply with quote

Sephiroth81 wrote:
It does not work :-(
I also tried to use cron to chmod all files in this folder. I added this to crontab :
Code:

1  *  * * * /bin/chmod -R 666 /home/dokumenty/

but it also does not work :-(


The umask thing should work, it works here, did you remount the disk after adding the changes to your fstab?
Back to top
View user's profile Send private message
Sephiroth81
n00b
n00b


Joined: 24 Jan 2005
Posts: 52

PostPosted: Wed Jan 04, 2006 12:13 pm    Post subject: Reply with quote

Yes I've remounted this partition. But I've found the solution. I've changed umask in rssh.conf an now it's working :)
But thanks for the tips
Back to top
View user's profile Send private message
frenkel
Veteran
Veteran


Joined: 13 May 2003
Posts: 1034
Location: .nl

PostPosted: Wed Jan 04, 2006 2:13 pm    Post subject: Reply with quote

Ok, glad it's working, didn't know ssh bypassed the umask option in fstab. I don't use umask for ssh, it was just local that I tested it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum