View previous topic :: View next topic |
Author |
Message |
Sephiroth81 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/114430976043898a50e6c8f.jpg)
Joined: 24 Jan 2005 Posts: 52
|
Posted: Wed Dec 07, 2005 6:34 pm Post subject: <SLOVED> SSH + chmod |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Voorhees51 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/29310527541c9055b8e2b8.gif)
Joined: 05 Nov 2003 Posts: 358
|
Posted: Wed Dec 07, 2005 7:27 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Sephiroth81 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/114430976043898a50e6c8f.jpg)
Joined: 24 Jan 2005 Posts: 52
|
Posted: Wed Dec 07, 2005 10:08 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Voorhees51 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/29310527541c9055b8e2b8.gif)
Joined: 05 Nov 2003 Posts: 358
|
Posted: Thu Dec 08, 2005 5:30 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Sephiroth81 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/114430976043898a50e6c8f.jpg)
Joined: 24 Jan 2005 Posts: 52
|
Posted: Tue Jan 03, 2006 9:17 am Post subject: |
|
|
Could any of You write down such a script? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
frenkel Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/5863892633fc10143dfad9.gif)
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Tue Jan 03, 2006 9:36 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Sephiroth81 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/114430976043898a50e6c8f.jpg)
Joined: 24 Jan 2005 Posts: 52
|
Posted: Tue Jan 03, 2006 9:56 am Post subject: |
|
|
This directory is on separate partition and it's mounted to /home/files.
So how can I set those default permissions ?? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
frenkel Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/5863892633fc10143dfad9.gif)
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Tue Jan 03, 2006 10:27 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Sephiroth81 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/114430976043898a50e6c8f.jpg)
Joined: 24 Jan 2005 Posts: 52
|
Posted: Wed Jan 04, 2006 11:17 am Post subject: |
|
|
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 ![Sad :-(](images/smiles/icon_sad.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
frenkel Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/5863892633fc10143dfad9.gif)
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Wed Jan 04, 2006 11:57 am Post subject: |
|
|
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 ![Sad :-(](images/smiles/icon_sad.gif) |
The umask thing should work, it works here, did you remount the disk after adding the changes to your fstab? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Sephiroth81 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/114430976043898a50e6c8f.jpg)
Joined: 24 Jan 2005 Posts: 52
|
Posted: Wed Jan 04, 2006 12:13 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
frenkel Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/5863892633fc10143dfad9.gif)
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Wed Jan 04, 2006 2:13 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|