Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
'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)
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
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.
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?
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
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.
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
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?
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?
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
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).
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...
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
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?
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...
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.