LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-06-2016, 12:00 PM   #16
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled

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.
 
Old 12-06-2016, 12:02 PM   #17
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by ParanoiaUser View Post
Nope.

--

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?
if a user writes a file. how is your directory structure made up? is this a controlled directory structure? As it should be so one cannot log in and go anywhere in that system.

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.
  1. Use chmod -R 755 /opt/lampp/htdocs if you want to change permissions of all files and directories at once.
  2. Use find /opt/lampp/htdocs -type d -exec chmod 755 {} \; if the number of files you are using is very large. ...
  3. Use chmod 755 $(find /path/to/base/dir -type d) otherwise. Better to use the first one in any situation.

http://linuxcommand.org/lts0070.php

Last edited by BW-userx; 12-06-2016 at 12:10 PM.
 
Old 12-06-2016, 12:09 PM   #18
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
Quote:
Originally Posted by ParanoiaUser View Post
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.
Put them in the same group, and give the group 'rw' permissions.
 
Old 12-06-2016, 12:12 PM   #19
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
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.

Last edited by ParanoiaUser; 12-06-2016 at 12:19 PM.
 
Old 12-06-2016, 12:13 PM   #20
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
Put them in the same group, and give the group 'rw' permissions.
Could you detail this ? what do i have to modify here exactly ?

user1:x:1000:user2
user2:x:1001:user1
 
Old 12-06-2016, 12:23 PM   #22
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,517

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619
well user "1000" is ROOT
root can do EVERYTHING

and user 2 SHOULD NEVER be able to do everything root dose
 
Old 12-06-2016, 12:25 PM   #23
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
well user "1000" is ROOT
root can do EVERYTHING

and user 2 SHOULD NEVER be able to do everything root dose
User "1000" is not root, it's just a user on the machine.

Last edited by ParanoiaUser; 12-06-2016 at 12:27 PM.
 
Old 12-06-2016, 12:31 PM   #24
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
I appreciate you linking me that, but instead of wasting time copy pasting me stuff and making me read thru tons of stuff you could of just told me what to modify here:

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.

Last edited by ParanoiaUser; 12-06-2016 at 12:34 PM.
 
Old 12-06-2016, 12:33 PM   #25
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by ParanoiaUser View Post
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.
OK this is what I did.

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)

userx@voided1.what/run/media/userx/WD3TB/testwrite>> su bob
Password: 
[bob@voided1 testwrite]$ ls
testpermissions
[bob@voided1 testwrite]$ cat testpermissions
tesing
[bob@voided1 testwrite]$ echo "more from bob" >> testpermissions
bash: testpermissions: Permission denied

[bob@voided1 testwrite]$ touch bobtestfile
[bob@voided1 testwrite]$ echo "ho usex try me" > bobtestfile
[bob@voided1 testwrite]$ cat bobtestfile
ho usex try me
[bob@voided1 testwrite]$ exit
exit


userx@voided1.what/run/media/userx/WD3TB/testwrite>> ls
bobtestfile  testpermissions
userx@voided1.what/run/media/userx/WD3TB/testwrite>> cat bobtestfile
ho usex try me
userx@voided1.what/run/media/userx/WD3TB/testwrite>> echo "added by userx" >> bobtestfile
bash: bobtestfile: Permission denied
this way with ftp when someone logs in they should be sent to that directory, per the ftp config file, then anyone that you allow to log in can look at everyone's files, create their own file, and write to it, and read others files but not write to anyone elses files.

Last edited by BW-userx; 12-06-2016 at 12:51 PM.
 
Old 12-06-2016, 12:37 PM   #26
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
OK this is what I did.

here I have a external HDD vis 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, then created a file, the add text to it. I logged as bob, read the file, but bob cannot add text to it.




I gave the Directory permissions 777. created another user called bob.

I cd into an external HDD hooked up USB. created a file under my user name, userx, then added text to it. Bob can see it, and read it but cannot write to it.

then I did the same with 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 creaton time.

Code:
userx@voided1.what/run/media/userx/WD3TB/testwrite>> chmod 777 $(find /run/media/userx/WD3TB/testwrite -type d)
userx@voided1.what/run/media/userx/WD3TB/testwrite>> su bob
Password: 
[bob@voided1 testwrite]$ ls
testpermissions
[bob@voided1 testwrite]$ cat testpermissions
tesing
[bob@voided1 testwrite]$ echo "more from bob" >> testpermissions
bash: testpermissions: Permission denied
[bob@voided1 testwrite]$ touch bobtestfile
[bob@voided1 testwrite]$ echo "ho usex try me" > bobtestfile
[bob@voided1 testwrite]$ cat bobtestfile
ho usex try me
[bob@voided1 testwrite]$ exit
exit
userx@voided1.what/run/media/userx/WD3TB/testwrite>> ls
bobtestfile  testpermissions
userx@voided1.what/run/media/userx/WD3TB/testwrite>> cat bobtestfile
ho usex try me
userx@voided1.what/run/media/userx/WD3TB/testwrite>> echo "added by userx" >> bobtestfile
bash: bobtestfile: Permission denied
userx@voided1.what/run/media/userx/WD3TB/testwrite>>
I want both users to have access to write files (for future files and folders created also), not only one of them.
 
Old 12-06-2016, 12:42 PM   #27
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
Quote:
Originally Posted by ParanoiaUser View Post
I appreciate you linking me that, but instead of wasting time copy pasting me stuff and making me read thru tons of stuff you could of just told me what to modify here:

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.
I look at it like this. You came here asking about users and permissions and have been on this thread for about 24 hours now, when you could have spent 15 minutes reading about users and permissions in any of those guides and did it yourself 23 hours ago.
 
Old 12-06-2016, 12:46 PM   #28
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
I look at it like this. You came here asking about users and permissions and have been on this thread for about 24 hours now, when you could have spent 15 minutes reading about users and permissions in any of those guides and did it yourself 23 hours ago.
I look at it like this, youre wasting both our time not providing a solution to what i am looking for.

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.

Last edited by ParanoiaUser; 12-06-2016 at 12:55 PM.
 
Old 12-06-2016, 12:54 PM   #29
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by ParanoiaUser View Post
I want both users to have access to write files (for future files and folders created also), not only one of them.
you really need to read up and test out permissions and what they allow one and many user to do when certain permissions are set on files, and directories instead of making us do all of your work for you.

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

Last edited by BW-userx; 12-06-2016 at 01:01 PM.
 
1 members found this post helpful.
Old 12-06-2016, 01:04 PM   #30
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
The commands, mentioned in the first paragraph of nearly any of my links:

Code:
groupadd, usermod, groupmod
Hopefully you can make use of those commands. Good luck. The reason you aren't getting a specific command is that I'm not sure I understand exactly what you need in your specific environment. If you look at and understand the commands you will be able to use them to do what you need though. Share what you try and your results and you will get more help.

/my-involvement

Last edited by szboardstretcher; 12-06-2016 at 01:10 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
changing the default permission for both directory and files to 775 with umask fermat97 Linux - Newbie 1 11-14-2014 07:02 AM
New user group permission to only three folders without being owner zilexa Linux - Newbie 8 07-09-2014 11:57 PM
Can you make any files and folders created within a directory owned by another user?? helptonewbie Linux - Newbie 13 12-14-2007 04:21 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
permission 775 to all folders and sub... amer_58 Linux - Newbie 3 04-23-2005 04:21 AM

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

All times are GMT -5. The time now is 11:23 PM.

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