G
G
German2018-03-20 18:49:20
linux
German, 2018-03-20 18:49:20

How to change the etc/passwrd file?

Unsure Linux user.
I found an article on how to get root rights to the folder etc ...
Changed the UID and GID of my user to 0, like root and saved the whole thing.
As a result, I received an Unknown user @ name in the console and not the ability to execute commands under sudo, and after rebooting, the password entry window simply does not exit. I can't log in at all...
How can I fix this situation? Is there any way to return these values?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir, 2018-03-20
@Casufi

If root login is disabled, the easiest way is to boot from livecd, mount the disk with the system and edit /etc/passwd to its original state.
If you completely broke the line with your user, then you can chroot into your system disk and create a new user
https://wiki.archlinux.org/index.php/change_root
You can also google single user mode if it boots from livecd there is no way

P
pfg21, 2018-03-20
@pfg21

editing /etc/passwd directly is not recommended.
there are commands for this useradd userdel usermod
if you have access to sudo why do you need root ??
give an example of your /etc/passwd there is nothing secret there.

P
prlepiped, 2018-03-21
@prlepiped

CTRL+ALT+T
nano /etc/passwd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question