How can i make user always create files + folders with 775 permission ? Please help
Hello,
I am trying to achieve the following on Debian, i need to have testuser create all his files + folders with 775 permission, everything this user creates i would like for it to have that permission. I would be VERY appreciative if someone could tell me how to do this. --- What will also work would be some way i could set a folder to always have that permission no matter what is written in it and by who. |
Have a look at umask.
|
Quote:
Reading about it but still no luck so far. |
Read some more?
|
in the users .bash_profile or .bashrc file add the line:
Code:
umask 0002 |
Thank you for your replies.
I have umask 0002 If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick :(. |
Quote:
this is a REMOTE login that should have been posted in the very first post and NOT just finding this out in post #6 what software are you using and what is the host? and you REALLY DO NOT !!!!! want remote users using 775 |
Quote:
|
Quote:
-- So, i have 2 users, we'll call them user1 and user2. User1 will have access to SFTP + SSH, user2 will have access only to FTP. If user1 creates a file, user2 will not have write permission for that file when connected to FTP. I need to give user2 write access to the file, how can i do this? |
Quote:
|
Quote:
Quote:
|
Quote:
|
Hello
Maybe this has to do with SFTP? If the idea is that they can transfer files but not run scripts, I think you need to put the umask in the sshd config. http://riaschissl.bestsolution.at/20...mask-for-sftp/ |
Quote:
user1:x:1000:user2 user2:x:1001:user1 Should i change something ? hmm. Maybe they are not added correctly ? |
Quote:
Quote:
|
Actually i want both users to be able to write, just have no idea how to do it so they can overwrite their files.
if user1 creates a file, user2 will not be able to overwrite it. |
Quote:
then the permissions need to be set to the directory where a(one) user is the owner and all others (users) can only read, and execute, just not write per 775 permissions granting. therefore others cannot write anything within that directory other then the owner.
http://linuxcommand.org/lts0070.php |
Quote:
|
If user1 creates a file, user2 will not have write rights to that file, i dont want this, i want him to have write rights.
I basically want the 2 users to have identical rights as far as file permissions go, i want them to be able to write, execute and read each other's files. EDIT: I want this permission to maintain for newly created files, folders and subfolders. |
Quote:
user1:x:1000:user2 user2:x:1001:user1 |
well user "1000" is ROOT
root can do EVERYTHING and user 2 SHOULD NEVER be able to do everything root dose |
Quote:
|
Quote:
user1:x:1000:user2 user2:x:1001:user1 Or simple steps to what exactly i can do to achieve what i am looking at achieving. |
Quote:
here I have a external HDD hooked up via USB under me, my user name. I created a different user bob. Off the terminal I cd to the external hdd, created a directory under my user name, userx, changed permissions to it to be 777, chmod 777 $(find /run/media/userx/WD3TB/testwrite -type d) then created a file, the add text to it. I logged as bob, bob can read the file, but bob cannot add text to it. then I did the same with bob, logged in as bob, he created a file, wrote to it. Userx can see it, read it but cannot write to it. do to the creators permissions set to the file at creation time. Code:
userx@voided1.what/run/media/userx/WD3TB/testwrite>> chmod 777 $(find /run/media/userx/WD3TB/testwrite -type d) |
Quote:
|
Quote:
|
Quote:
Have a clear answer or not ? I am not here to learn linux, i am here to fix a specific issue. I've read about groups in the past also...and also now, i am stupid and i can't do what i want to, enlighten me with a clear solution please. I see this as me asking how much does 4+4 equal and being handed a math book to learn math. Edit: Even if i may sound rude, i am not trying to be, i'm just looking for clear answers, i don't want to waste time (and the 2 user's time) experimenting with all kinds of stuff to see if it works and also possibly breaking who knows what in the process. |
Quote:
Just because you're not wanting to learn how to use Linux, well guess what if you are not using Windows and have to deal with Windows you still have to learn how to use it. what does permissions 777, 775, 755 do ? if you set them on a directory, and if you set them on a file? what differences does one get between the two ? not to mention permissions 666 |
The commands, mentioned in the first paragraph of nearly any of my links:
Code:
groupadd, usermod, groupmod /my-involvement |
depending on the OS
500 is root or 1000 is root |
Quote:
|
Guys, let me explain in more detail.
I have user1 with SFTP+SSH access to a machine. User1 runs processes and creates files in home/user1/foldername User2 has FTP only access, no sftp or ssh and is chrooted to home/user1/foldername Having: user1:x:1000:user2 user2:x:1001:user1 set in etc/group. When user1 creates a file in home/user1/foldername, user2 will not be able to modify that file. I need both user1 & user2 to have read,write&execute(if execute is needed to delete a file) permissions on all files located in home/user1/foldername !BUT! also future files & folders + subfolders that will get created there, for example: home/user1/foldername/newfolder/newfile.txt |
|
I see what you mean. And it appears you don't have much grasp of the ownership/permission fundamentals which is alright at the beginning. If you want to become more efficient, you need to understand the concept of it.
You have few issues there: - Quote:
- You have haphazardly granted group membership to each other without considering its implication. If you really want a shared resource, why not allocate a separate location with a common group membership? - It is advisable to create a shared folder outside one's $HOME. Why don't you start from simple setup and work your way up from there? We're you able to even get past the SFTP setup? |
VSFTPD
Code:
# Example config file /etc/vsftpd.conf etc/passwd Code:
user1:x:1000:1000:,,,:/home/user1:/bin/bash Code:
user1:x:1000:user2 |
Quote:
Quote:
|
Quote:
Give me clear answers on what i need to modify to resolve my issue if you want to help me and i'll be appreciative, if not, please dont reply. |
Well, I'm just trying to point out where you can improve your setup. If that is not appreciated, that's all good. Good luck.
|
Yep, of no use.
You dont tell me how to improve it = useless to me, i don't need someone telling me "you can go learn to do this" i need someone to tell me exactly what i need to do to solve this specific problem i've posted about, i don't want to go read hundreds of text lines, if i wanted to do that i wouldnt be here asking for your help. I believe my problem is Very basic & simple to solve, i am not trying to become a network administrator for NASA you know ? i am asking simple questions here. |
Quote:
if it is so simple then why are you asking us how to fix it. You NOT wanting to learn how to set up your own system and its software is not very productive on your part. Like I and another has suggested to set up a directory pool share type setting then set permissions to that parent directory so everybody can play inside of it without destroying others toys. allowing others to log into someone else home is not a good idea. https://ubuntuforums.org/showthread....55#post3138955 |
Quote:
Show some gratitude and not attitude. |
10$ BTC to who helps me solve this first with exact steps.
I don't have time for useless replies and other bullshit lectures, tell me what i want to know faster and in a way my stupid brain can understand it. |
You skipped a question, "what does your chroot configuration for this user look like?"
Not super familiar with Debians config location. You might have to look it up. In centos its directory is /etc/schroot/ |
I think you need to read everything again then rethink your attack on this issue you are having. What apps are you going to use, ssh / SFTP / vsftp -if one user has both and another user has only ftp, then screw that other guy with his ssh, and make him only use ftp so the two users can relate properly using the ftp set up. less head ache.
then just set up your ftp sight accordingly. with a area they both can play in and not have to worry about the other destroying his toys, and visa a versa. Nor being able to do something in someone esles home directory. only a root admin and the user is suppose to be able to get into it. |
http://unix.stackexchange.com/questi...ww-with-vsftpd
VSFTP chroot or jail users – limit users to only their home directory howto Allowing FTP Access to Files Outside the Home Directory Chroot yep, you're going to have to use your brain to figure out some of this stuff. calling yourself stupid and telling yourself you can't do this or that is bad, stop bad. |
Can you guys stop worrying about stuff thats not related to what i am asking ?
I WANT this user to be in the other's home, there are only 2 users on this machine, just answer my question with clear modifications i need to make and stop worrying about things i am not asking about. "what does your chroot configuration for this user look like?" user2:x:1001:1001:,,,:/home/user1/randomfolder:/bin/bash user2 has SSH deny. Quote:
See: Quote:
|
Quote:
|
Quote:
|
Code:
|
All times are GMT -5. The time now is 06:09 AM. |