LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-05-2007, 12:29 PM   #1
Fill
Member
 
Registered: Jun 2007
Posts: 96

Rep: Reputation: 16
file permissions problem


I have an FTP server, and I need to give access to 2 different users to a folder on my home directory. One of that users, is my account, the other is the username that is going to be used to connect to the FTP server. Now, i have some problems with file permissions. If the other user connects to my server and uploads a file, I have full access to it - I can write, read, etc... but if I change that file or create a new one,
he is even unable to download the files
*the file
It tells permission denied
I created a new users group with my username and his username
then, chmod -R 770 directory
but no way, the problem is, now when I create a new file, the owner is my username - ok - but the owner group is the same as my username, and I wanted it to be the users group I created
autommaticly
I don't know what to do, does anyone have any idea?
 
Old 08-05-2007, 12:46 PM   #2
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 297

Rep: Reputation: 49
Quote:
Originally Posted by Fill
then, chmod -R 770 directory
'chmod 2770 directory' will make sure files are created with the same group as the directory. (Not quite sure this will also work with ftp, but it probably will)
 
Old 08-05-2007, 12:56 PM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
What do you want? Do you want that all files that you create would have the new group by default or do you want to have this only for FTP folder?

For the first, try usermod. You need to change group of your username and add the old group as an additional one. Note that you may need to specify all additional groups at once with -G (-A is better here), so be careful and backup your /etc/group* files. Or you can just change group in /etc/passwd.

In the second case maybe it will be simpler to have a process running in background: 'while true; do sleep 120; chown -R :commongroup /home/ftp/upload ; done' or something like that.
 
Old 08-06-2007, 01:39 AM   #4
kennithwang
Member
 
Registered: Aug 2007
Location: shanghai
Distribution: LDD
Posts: 32

Rep: Reputation: 15
Ramdisk size.............

Hi guys,

I am an linux embedded SW engineer, I have a problem as follows,

-you can set the size of ramdisk as default value, when you compiled your kernel; then you can change its size in rootFS,
But how to fix the right ramdisk size for application software, which can be fit for their running? If not, this problem will result in system crashed or its unnormal running?

Have you experienced the same problems?

Thanks in advance,
Kennith
 
Old 08-06-2007, 03:39 AM   #5
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
Well, thanks for everything, but it isn't still working...

chmod 2770 didn't work.

and yes raskin, I want all files that I create have the new group by default, BUT only in a specific directory. Is this possible?

Tell me more about that...
 
Old 08-06-2007, 03:52 AM   #6
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
First, rupertwh's solution should work if directory's group is the group you want to be the group of all the files there. But it only works one level deep, so if there is a directory inside, on the second level files will not be group-readable by default. Also check if it is not just configured FTP server behavior: create a file with the common group and your ownership and check if it can be downloaded; or even try to upload and immediately download file.
 
Old 08-06-2007, 05:02 AM   #7
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
yeah, rupertwh's solution worked, and with the -R option it is now activated to all the sub directories.

It is almost resolved, there is still one small issue:

When I create a new file, the owner group is the other group, the group of the 2 users - perfect.

But by default the group has only read access to the file ... however I'm glad that when I create a new file in the directory it is autommaticly owned by the group I want...

Now I just have so resolve this: by default the group only gets read access to the file
 
Old 08-06-2007, 05:58 AM   #8
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
I have found something about changing my umask ... They told me to edit /etc/profile archive, but changing the umask in that archive would change it in all debian users, am I right?

How do I change MY umask?
 
Old 08-06-2007, 02:09 PM   #9
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Put command 'umask 002' in .bash_profile or whatever your shell parses at top-level login.
 
Old 08-06-2007, 05:03 PM   #10
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
That's what I read on the internet and I've been trying to do it all day.

The problem now is:

a) I'm a completly

lool

b) I set the umask value to 002 in my .bashrc and .bashrc_profile files, and when I type 'umask' in the console I get the value '002', therefore it should work.

However when I create a new file, it seems like umask does not work, the new file still get permissions 644, and with the umask value I set it shouldn't ... it keeps creating the new files considering the old umask values...

BUT the umask is set to 002, as I checked in the console!

What should I do now?

I heard someone telling me to try and reboot the system after set the new umask, is it necessary? If it is, please tell me, because the pc is running 24/7 ... do I really need to reboot my system after change the umask value?

If it is, isn't there anyway to activate the new umask without having to restart the system?

Thanks in advance for the help...
 
Old 08-06-2007, 05:20 PM   #11
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
How do you create a file? by uploading it? Then your umask may be ignored by FTP server. In a worst case, umask 022 is hard-wired deep into it (surely it can change its own umask).
 
Old 08-07-2007, 02:13 AM   #12
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
No, I create the file localy, in the server directory, I don't upload it because I'm the owner of the pc, so I create the file on the computer, directly...

I only create files by uploading them if I'm holiday and so I can't create them localy. But yes, proftpd has a setting to define the umask for the uploaded files - so I can change the FTP Server's umask.

But the local umask, the one I change in the bashrc file, seems that it doesn't work...
 
Old 08-07-2007, 02:44 AM   #13
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Hm. Looks strange. And does umask work when you create files inside your home directory? By the way, do you use FTP only for remote uploading/downloading files when you are away from the computer? Don't you want to set up SSH server - you will get rid of 'this user can this and not that' hassle without loss of security?
 
Old 08-07-2007, 06:38 AM   #14
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by raskin
Hm. Looks strange. And does umask work when you create files inside your home directory? By the way, do you use FTP only for remote uploading/downloading files when you are away from the computer? Don't you want to set up SSH server - you will get rid of 'this user can this and not that' hassle without loss of security?
I only tried in a subdirectory under my home directory. But I'm going to try in my home directory.

About the FTP Server and SSH ... I have to run the FTP Server, because I also share some files with my friends and other things, even this permissions problem is related to that...
 
Old 08-07-2007, 06:40 AM   #15
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
tried to change again the umask in .bashrc.

Then, I created a new text document and saved it on my home directory, and the same thing happened - the 'umask' command in the console tells me my current umask is 6, but the files are saved as if I had an umask of 22...

even on the home directory
 
  


Reply



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
Problem with file permissions from windows dejavu_01 Linux - Newbie 3 12-29-2006 11:06 PM
problem with file permissions charmsqueen Linux - Software 1 02-07-2006 07:08 PM
A slight problem with file permissions f0rk Slackware 4 07-26-2005 08:57 AM
file system permissions problem guy24x Linux - Security 8 04-07-2005 06:09 PM
File Permissions Problem sjb142 Linux - Networking 3 12-05-2003 06:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:21 AM.

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