Unable to delete the file in Linux [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I created the directory "science" using mkdir science from /home/anu directory. And typed chmod 664 science.
step 2:-
/home/abc/science -> created a file chemistry in it using touch chemistry and typed chmod 664 chemistry.
Step 3:- Added new user to group anu using "usermod -aG anu user1" .
Step4: Went to /home/user1 and typed rm -rf /home/anu/science/chemistry but got access denied even when i am a part of group anu.
Please can you advise.

When you create new users and adding them to new groups it's recommended to relogin under new session.
Also, show rwx permission for /home/anu, /home/anu/science and /home/anu/science/chemistry. Chances are - there is an answer

your folder(science) is 664 which does not allow you to rm file(chemistry) in it. Change folder to 774 and have a try

Related

Remove group ownership of a directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm creating a page with all the commands I use or need but I can't find how to remove a group ownership of a directory, all the pages show how to add it, but how do you remove it? Let's say I have a dir called myFolder, and the group admin owns it, how can I leave the folder with no group ownership?
I know to add is like: chown -hR myGroup: /var/www
Thanks
EDIT:
Let me put it more clear, I have a folder with this permissions:
drwxr-xr-x 2 arturo root
How can I remove/get out/eliminate/disappear arturo from there and leave it how it came out when I create it? I gess root root
If you want to reset the directory's ownership to root, then you can use this command:
chown root:root /var/www -R
You unable to just remove ownership. In the Unix/Linux, any file or directory must belong to some group. However, you can change group owner to nobody, or create special group, for example - dummy, and change ownership to that group.
To add a new group, you can use command groupadd (Linux) or pw groupadd (FreeBSD).

Convert file or directory to symbolic link and preserve permissions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have /home/eric/public_html with drwxr-x--- eric:nobody as the mod and ownership.
I login with eric so I cannot recreate this folder without root access, since eric is not part of the nobody group.
I want to replace my public_html with a symbolic link (i.e. ln -s ~/git/project/src ~/public_html) but if I do that, my new public_html ends us without the correct permissions.
Is there a trick to get around this without contacting my admin?
Possibly by doing the following:
Copy everything from ~/git/project/src into ~/public_html
mv ~/git/project/src ~/git/project/src2 to get it out of the way
mv ~/public_html ~/git/project/src
finally link it back: ln -s ~/git/project/src ~/public_html
The idea is to keep the original public_html directory because it has the correct owner/permissions, but reuse it as the link target.

Unable to create a 777 file on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
How can I create a file (not directory) with execution permissions using umask?
I know files use 666 permissions and directories 777 but I want to create files with 766, for example.
Use chmod to change the file permissions.
chmod 777 some-file
Or set the umask
umask 000
Strictly using umask, you cannot do this. Unless you are specifically creating an executable file with, say, gcc, the default permissions will be 666 minus umask. You must use chmod to add the executable bit to a standard file.

Linux Operation not permitted [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
After I accidentally used the command chown /var/www/moodle, I couldn’t change the root directory to be /var/www/moodle, so that I can't install phpmyadmin.
I have looked some suggestions but not very useful, I guess the permission has now changed, the other problem is I don't remember in which root directory I have used the above command.
What I get right now:
chroot: cannot change root directory to /var/www/moodle: Operation not permitted
I am using linux for the first time.
Your first command, the chown /var/www/moddle, was syntactically bad. You had to run some other, if you didn't get back an error message.
First, try a
chown root:root /var/www/moodle
...although a chroot command should be able to be called. Probably there is also another problem, what gets you if you call a
chroot /var/www/moodle
?

How to add a user without using the 'useradd' or 'adduser' commands in RHEL6.3? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I want to add a user in a RHEL6.3 OS without using useradd or adduser command.
I know that I have to edit in 4 files i.e passwd, group, shadow and gshadow.
But please tell me what exactly I have to edit?
Still not recommend to create a new user manually, but you can follow below steps to do it. For example, you need create a new user user3185704
(before edit, backup /etc/passwd, group, shadow)
edit /etc/passwd, add below line:
user3185704:x:100:1000:user3185704,,:/home/user3185704:/bin/bash
if group (gid=1000) is exist, no need update /etc/group , otherwise, add a new group line in /etc/group.
add below line in /etc/shadow
user3185704::::::::
create home directory
mkdir /home/user3185704
chown 100:1000 /home/user3185704
set password
password /home/user3185704
manually test you can login
su - user3185704

Resources