Permission error when "touch"ing file with different user


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
Permission error when "touch"ing file with different user

Hi,

There are 2 users (T886072 & T864764) that need to be provided full (rwx) access to a directory. I made the changes to the directory permissions using chmod and setfacl :

Code:
root@digidb2:[/root]# chmod 700 /u02/ftpfiles/MFRS16/discount_rates/
root@digidb2:[/root]# setfacl -s user::rwx,group::---,other:---,mask:rwx,user:T886072:rwx,user:T864764:rwx /u02/ftpfiles/MFRS16/discount_rates

This is how the directory permissions look after changes have been made :

Code:
root@digidb2:[/u02/ftpfiles/MFRS16/discount_rates]# ls -ld .
drwx------+  2 applprod other         96 Jan 18 11:21 .
root@digidb2:[/u02/ftpfiles/MFRS16/discount_rates]# getfacl .

# file: .
# owner: applprod
# group: other
user::rwx
user:T886072:rwx                #effective:rwx
user:T864764:rwx                #effective:rwx
group::---              #effective:---
mask:rwx
other:---
root@digidb2:[/u02/ftpfiles/MFRS16/discount_rates]#

With these permissions, the users are able to cd into the directory and touch files without problems. However, if I re-touch the same filename in the directory, I get the error below only for user T864764 .The other user (T886072) does not have this problem.

User T886072 :

Code:
bash-3.00$ id
uid=1331(T886072) gid=1(other)
bash-3.00$ pwd
/u02/ftpfiles/MFRS16/discount_rates
bash-3.00$ touch abc
bash-3.00$ ls -lrt
total 0
-rw-r--r--   1 T886072  other          0 Jan 18 14:34 abc
bash-3.00$ touch abc
bash-3.00$ ls -lrt
total 0
-rw-r--r--   1 T886072  other          0 Jan 18 14:34 abc
bash-3.00$ touch abc
bash-3.00$ ls -lrt
total 0
-rw-r--r--   1 T886072  other          0 Jan 18 14:35 abc
bash-3.00$ touch abc
bash-3.00$

User T864764 :

Code:
$ id
uid=1332(T864764) gid=1(other)
$ pwd
/u02/ftpfiles/MFRS16
$ bash
bash-3.00$ cd discount_rates/
bash-3.00$ pwd
/u02/ftpfiles/MFRS16/discount_rates
bash-3.00$ ls -lrt
total 0
-rw-r--r--   1 T886072  other          0 Jan 18 14:35 abc
bash-3.00$ touch abc
touch: cannot change times on abc: Permission denied
bash-3.00$ touch abc
touch: cannot change times on abc: Permission denied
bash-3.00$

Please help debug why this problem happens.
# 2  
User T864764 is not the owner of this file abc and cannot recreate it.
-rw-r--r--
Second user in the same group so you can only read it. r--
To change the file, you need to add permissions to this file from the first user.
-rw-rw-r--

--- Post updated at 08:35 ---

Or create another file
Code:
touch ABC

go to the first user and you also can not update the new file ABC.
These 2 Users Gave Thanks to nezabudka For This Post:
# 3  
Be aware that the title you chose for this thread ("Getting error when touch more than 1 instance of the same file") was somewhat misleading - I modified it for you, moved it to an adequate forum, edited the tags, and added the "solved" tag.
This User Gave Thanks to RudiC For This Post:
# 4  
Hi anaigini45,

you set extended permissions for the directory - but not for the files(You'l see that if you look at getfacl yourfile). The directory permissions are not inherited to the file. If you want to have it that way, you must set the extended permissions in some way.

Regards,
Stomp

--- Post updated at 12:53 PM ---
Anyway: You did not mention anything about your environment. Help could be more useful with details about that. My local version of setfacl does not support an -s option.

My setfacl here says it is possible to use the -d option to specify a default acl, which is used for any element, created in that directory. This may help you. Have a look into your manpage of setfacl.(I can not help you with other unices than linux here anyway).


Quote:
Originally Posted by RudiC
and added the "solved" tag.

To me this thread is not solved.

Last edited by stomp; 01-18-2019 at 09:08 AM..
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #268
Difficulty: Easy
In 1936, Turing published his paper 'On Computable Numbers, with an Application to the Entscheidungsproblem'. In this paper, Turing reformulated Kurt Godel's 1931 results on the limits of proof and computation, replacing Godel's universal arithmetic-based formal language with the formal and simple hypothetical devices that became known as Turing machines.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. UNIX for Dummies Questions & Answers

What is the significance of sh -s in ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh?

Please can you help me understand the significance of providing arguments under sh -s in > ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies

4. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. UNIX for Dummies Questions & Answers

changing password with sudo user " permission denied"

HI All, I am using solaris i created a user adam and updated his permissions in vi sudoers file as follows adam ALL=(ALL) NOPASSWORD: ALL ........... when i create user by logging as sudo user . $ sudo useradd -d /home/kalyan -m -s /bin/sh kalyan sudo: not found ... (6 Replies)
Discussion started by: kalyankalyan
6 Replies

7. Shell Programming and Scripting

Ignore "a line" within /etc/profile only when su'ing

Is there a way to ignore a command within /etc/profile only when su'ing as any particular user. For instance.... As root, if I run "su - oracle -c program" it is running a string in my profile called "echo "^2;$(hostname)-(ABC) @ $(who am i)^G". I don't want the above string to run if I... (9 Replies)
Discussion started by: lwif
9 Replies

8. UNIX for Advanced & Expert Users

Command similar to "touch" for modify File size

Hi All, I'm trying to find a command like similar to "touch" which would let me change the file size property. For ex: I have a file of size 1MB using the command i would like to set/update the size something like 1KB. Is it possible? Is there any such command which would accomplish this... (3 Replies)
Discussion started by: sriharshareddyk
3 Replies

9. Shell Programming and Scripting

communicating wth another user aside from "wall" and "write"

Hi, Can anyone suggest a Unix command or c-shell algorithm to simulate to behavior of "wall" command minus the "all users"? What I'm trying to do is to send a notice to just one particular user but i dont want other remotely-logged-on users to receive the message (on the pseudo-terminals). I... (6 Replies)
Discussion started by: Deanne
6 Replies

10. UNIX for Dummies Questions & Answers

"vi"-ing a constantly updated file

Hi, A bit of a dumb question here. Sorry folks. Suppose I have this file which is being updated at irregular intervals (a few seconds, a few minutes, who knows) by a background process. I 'vi' this file with the intention of editing it, so it opens up a temp copy as the usual... (8 Replies)
Discussion started by: Percy
8 Replies

Featured Tech Videos