LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-13-2022, 09:58 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,699
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i am trying to give the world permission to read and write but it seems to never work


i am trying to give the world permission to read and write but it seems to never work.
Code:
lt1a/phil/3 /home/phil 28> ls -dl /tmp/p
-rw----rw- 1 root root 25 Aug 13 22:49 /tmp/p
lt1a/phil/3 /home/phil 29> cat /tmp/p
cat: /tmp/p: Permission denied
lt1a/phil/3 /home/phil 30>
 
Old 08-13-2022, 11:07 PM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,499
Blog Entries: 7

Rep: Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585
i am trying to give the world permission to read and write but it seems to never work

There are no group permissions set.

You need to set them too.
 
Old 08-14-2022, 03:53 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,929

Rep: Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046
Quote:
Originally Posted by rkelsen View Post
There are no group permissions set.

You need to set them too.
That should only be significant if the executing user, which looks to be "phil", is in the "root" group¹.

___
1) which is possible, but would not be the best idea.

Last edited by GazL; 08-14-2022 at 03:54 AM.
 
1 members found this post helpful.
Old 08-14-2022, 10:33 AM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,162
Blog Entries: 6

Rep: Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836Reputation: 1836
Code:
__touch /tmp/p.txt

__ls -l /tmp/p.txt
-rw-r--r-- 1 me me 0 Aug 14 10:19 /tmp/p.txt

__chmod 666 /tmp/p.txt 

__ls -l /tmp/p.txt
-rw-rw-rw- 1 me me 0 Aug 14 10:19 /tmp/p.txt

echo "Hello" > /tmp/p.txt

cat /tmp/p.txt
Hello

__sudo chown root:root /tmp/p.txt

__ls -l /tmp/p.txt
-rw-rw-rw- 1 root root 6 Aug 14 10:22 /tmp/p.txt

cat /tmp/p.txt
Hello
Sorry, had to add underscores to be able to post.
 
Old 08-14-2022, 10:43 AM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,660

Rep: Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584
Quote:
Originally Posted by teckk View Post
Sorry, had to add underscores to be able to post.
That's due to LQ's stupid CloudFlare filters picking up on the "\nls -l" within your post.

An easier workaround - which still maintains valid syntax - is to either add a space or backslash before "ls", or put a different option before the "l" param.

 
Old 08-14-2022, 11:10 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,275

Rep: Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342
Is there a umask taking away the permissions?
 
Old 08-14-2022, 11:12 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,163

Rep: Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380Reputation: 7380
theoretically it may depend on the permissions of the directory /tmp (and also of /), but we don't know them.
 
Old 08-14-2022, 11:15 AM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,767

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Skaperen View Post
i am trying to give the world permission to read and write but it seems to never work.
Code:
lt1a/phil/3 /home/phil 28> ls -dl /tmp/p
-rw----rw- 1 root root 25 Aug 13 22:49 /tmp/p
lt1a/phil/3 /home/phil 29> cat /tmp/p
cat: /tmp/p: Permission denied
lt1a/phil/3 /home/phil 30>
/tmp/p is (appears to be) a directory, to the “execute”bit must be set for it to be read…try
Code:
chmod 707
 
Old 08-14-2022, 02:13 PM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,929

Rep: Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046Reputation: 5046
Don't think so. The first character of the ls -l output would be 'd' if it were a directory. Also, the link count would be higher than 1.
 
1 members found this post helpful.
Old 08-14-2022, 02:34 PM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,767

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by GazL View Post
Don't think so. The first character of the ls -l output would be 'd' if it were a directory. Also, the link count would be higher than 1.
Good point…my bad. Never mind
 
Old 08-14-2022, 04:49 PM   #11
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Worked for me meaning I could not reproduce it.

A wild guess: #3: phil is member of 0(root) group.

please post the output of:

id
IF not in 0(root) group, then:
head -1 /etc/group
And then look for: ?'fs weirdness'?:
ls -ld /tmp; df /tmp; grep /tmp /proc/mounts

And if still not, ?#1: what distro???
(custom Solaris From Scratch? )

Apparently the ugo hierarchy is followed.

I couldn't come up with the right Web Search keywords to get a good article that explains this. I tried:
unix|linux follow first match permission order hierarchy

Last edited by !!!; 08-14-2022 at 05:35 PM.
 
Old 08-14-2022, 07:19 PM   #12
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,699

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
yes, user phil is in root group. so i guess that causes it to check the group permission. will need to check why my upgrade to Xubuntu 20.04 put some users in group root. i've been using -rw----rw- on these files (single letter in /tmp, owned by root, intended to allow every user to read or write without being able to change permissions). yeah, i could change to -rw-rw-rw- but i've had -rw----rw- on these for ages. i do this because i switch between users very often but copy & paste doesn't go between users (separate X servers).
 
1 members found this post helpful.
Old 08-14-2022, 07:57 PM   #13
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,499
Blog Entries: 7

Rep: Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585Reputation: 2585
Quote:
Originally Posted by Skaperen View Post
yes, user phil is in root group. so i guess that causes it to check the group permission.
Yeah, that sounds right.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I usually never post intro threads for myself, but this time seems appropriate. antithesis85 LinuxQuestions.org Member Intro 3 08-01-2020 01:32 AM
How to enable a Hard Disk to read/write to a USB device but disable the USB device to read/write to the hard disk without user permission? ce309 Linux - General 33 05-22-2019 04:30 PM
[SOLVED] CDROM seems to be there but also seems not to be mounted. Crb999 SUSE / openSUSE 47 02-06-2017 03:33 PM
read/write,write/write lock with smbclient fails swatidas11 Linux - Networking 1 03-10-2010 12:27 PM
How do I give users read but not delete permission suse7.1user Linux - General 2 09-03-2003 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:20 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