• Home
  • Downloads
  • Contact Us
  • Report Broken Link
Sunday, May 11, 2025
  • Login
lessons4you.info
  • Videos
  • Downloads
  • Help
    • Contact Us
    • Report Broken Link
No Result
View All Result
  • Videos
  • Downloads
  • Help
    • Contact Us
    • Report Broken Link
No Result
View All Result
Lessons4you.info
No Result
View All Result

Grub 2 Error: Invalid Signature press any key to continue…

Google Apps Script

sudo: unknown user: root (Linux/ubuntu/Debian/CentOS)

by
December 11, 2021
in Uncategorized
Reading Time: 2 mins read
A A
Share on FacebookShare on Twitter

Problem:

There is no root user in /etc/passwd – I accidentally overwrote it.

Solution:

Download ubuntu Live CD Image and create bootable pendrive or CD. Then boot the system with this pendrive/cd. Now, Open terminal and edit the /etc/passwd file. But, It may not allow to edit this file because it can not be edited by any user except root. So, you have to login with root. Follow these instructions to login with root,

1
2
3
 
$ sudo passwd root
 

It will ask you to set the root password, set the password and login with root.

1
2
3
 
$ su root
 

The passwd file you have to edit will not be there in /etc/passwd location, It is in /media/root/etc/passwd. If linux partition is not mounted then mount it. Now, Put the following into the first line of /media/root/etc/passwd (which is /etc/passwd file for your original os):

1
2
3
 
root:x:0:0:root:/root:/bin/bash
 

Know more about /media/root/etc/passwd

Traditionally, the /etc/passwd file is used to keep track of every registered user that has access to a system. The /etc/passwd file is a colon-separated file that contains the following information:

1
2
3
4
5
6
7
8
9
 
User name
Encrypted password
User ID number (UID)
User's group ID number (GID)
Full name of the user (GECOS)
User home directory
Login shell
 

The following is an example of an /etc/passwd file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
root:!:0:0::/:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:
guest:!:100:100::/home/guest:
nobody:!:4294967294:4294967294::/:
lpd:!:9:4294967294::/:
lp:x:11:11::/var/spool/lp:/bin/false
invscout:x:200:1::/var/adm/invscout:/usr/bin/ksh
nuucp:x:6:5:uucp login user:/var/spool/uucppublic:/usr/sbin/uucp/uucico
ishtiyaq:x:201:1::/home/ishtiyaq:/bin/bash
 

Previous Post

Grub 2 Error: Invalid Signature press any key to continue…

Next Post

Google Apps Script

Related Posts

How To Install The TWRP Recovery on Xiaomi Redmi 1s
Uncategorized

How To Install The TWRP Recovery on Xiaomi Redmi 1s

May 14, 2022
MIUI Collection Of Gapps (2.3.x – 5.0.x)
Uncategorized

MIUI Collection Of Gapps (2.3.x – 5.0.x)

May 14, 2022
Download Android 5.1.x Lollipop PA Gapps
Uncategorized

Download Android 5.1.x Lollipop PA Gapps

May 15, 2022
Download gapps for Android 5.1 Lollipop Cyanogemod 12.1
Uncategorized

Download gapps for Android 5.1 Lollipop Cyanogemod 12.1

May 14, 2022
Reddit AMA with OxygenOS Team OnePlus
Uncategorized

Reddit AMA with OxygenOS Team OnePlus

May 14, 2022
How to Remove Adobe Updater from OS X Menu Bar?
Uncategorized

How to Remove Adobe Updater from OS X Menu Bar?

July 19, 2023
Next Post

Google Apps Script

  • Home
  • Downloads
  • Contact Us
  • Report Broken Link

© 2022 lessons4you.info

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Videos
  • Downloads
  • Help
    • Contact Us
    • Report Broken Link

© 2022 lessons4you.info