chmod not working in a non super user
10,716
All I need to do is to be in the directory which contains the file. Solution:
cd home
chmod 777 *.txt
That's all.
But be aware to change the name of the file because the *
in *.txt
isn't a valid name.
Related videos on Youtube
![Johny Nassar](https://i.stack.imgur.com/a1eoE.jpg?s=256&g=1)
Author by
Johny Nassar
Updated on September 18, 2022Comments
-
Johny Nassar almost 2 years
I have created a file named
*.txt
in/home
using following command:sudo nano *.txt
Then I have changed owner of
*.txt
to auser
that I've created:sudo useradd -c "ABC"
sudo chown ABC *.txt
I login to
ABC
by typing:sudo login ABC
I tried to change permission of the file:
sudo chmod 777 *.txt
This is the result:
ABC is not in the sudoers file. This incident will be reported.
Permissions have successfully changed when running
chmod
from the original user:batman
.How can I change the permissions of
*.txt
from the new owner?-
Andrea Corbellini over 8 years1. please copy & paste output instead of screenshots; 2. to use
sudo
in Ubuntu you need to be in thesudo
group (or you need to be in the sudoers file like the error suggests); 3. you're getting "no such file or directory" because you forgot tocd
to the right directory -
Johny Nassar over 8 yearsWhat's the right directory? It should be in ABC user, right?
-
Andrea Corbellini over 8 yearsNo, you created the files in your home directory, they can't be in ABC's home directory:
cd ~batman; chmod 744 *.txt
-- but you may get errors depending on the directory permissions -
Johny Nassar over 8 yearsI'm new to Ubuntu so I don't get it 100% the group idea. Sorry.
-
Johny Nassar over 8 yearsBut the
ABC
user is the new owner of this file. Right? How can I fix it ? -
Johny Nassar over 8 years@AndreaCorbellini I didn't understand, plz could you explain more
-
-
Johny Nassar over 8 yearsI have some questions: 1. How can I make a home directory for
ABC
. 2. When I make achmod
, It's obligatory that I must go to the file location? 3.When I tried tochmod
in thebatman
it's successfully completed and there's no problem with that!! Why? Thanks.