ubuntu cannot boot after modifying /etc/passwd
Clash Royale CLAN TAG#URR8PPP
The following are the steps I destroyed my ubuntu:
- I installed Windows 10 and Ubuntu 18.04 in my computer;
- I modified the /etc/default/grub and set
GRUB_TIMEOUT = 0
, then I cannot see the Grub screen; (This is what I wanted.) - I modified the /etc/passwd and set
username:x:1000:1000::
to beusername:x:0:0::
, then the system asked me to create a new user when I reboot the system. (I intended to raise the privilege of the username.) - The result is that I cannot boot the system anymore.
- If I press ESC when booting, it will show
A start job is running for hold until boot process finishes up (~min ~s/no limit)
. - The installation CD can still work.
I need to recover the system.
boot passwd
|
show 1 more comment
The following are the steps I destroyed my ubuntu:
- I installed Windows 10 and Ubuntu 18.04 in my computer;
- I modified the /etc/default/grub and set
GRUB_TIMEOUT = 0
, then I cannot see the Grub screen; (This is what I wanted.) - I modified the /etc/passwd and set
username:x:1000:1000::
to beusername:x:0:0::
, then the system asked me to create a new user when I reboot the system. (I intended to raise the privilege of the username.) - The result is that I cannot boot the system anymore.
- If I press ESC when booting, it will show
A start job is running for hold until boot process finishes up (~min ~s/no limit)
. - The installation CD can still work.
I need to recover the system.
boot passwd
2
Have you tried mounting the root filesystem using the installation CD and reverting/etc/passwd
?
– Torin
Feb 26 at 12:02
@Torin Thanks for your comment. I tried mounting it but I can only see the files under the directory of username. That is I cannot find the file/etc/passwd
.
– haik
Feb 26 at 12:05
1
Sounds like you have seperate partitions for home and root. There should be another mountable partition containing your root which will contain/etc/passwd
– Torin
Feb 26 at 12:11
And it's weird that when I runsudo chroot /mnt
, it will hintfailed to run command ‘/bin/bash’: No such file or directory
. But I indeed see the file/bin/bash
.
– haik
Feb 26 at 12:18
3
You're mounting the wrong filesystem then.
– Kusalananda
Feb 26 at 12:27
|
show 1 more comment
The following are the steps I destroyed my ubuntu:
- I installed Windows 10 and Ubuntu 18.04 in my computer;
- I modified the /etc/default/grub and set
GRUB_TIMEOUT = 0
, then I cannot see the Grub screen; (This is what I wanted.) - I modified the /etc/passwd and set
username:x:1000:1000::
to beusername:x:0:0::
, then the system asked me to create a new user when I reboot the system. (I intended to raise the privilege of the username.) - The result is that I cannot boot the system anymore.
- If I press ESC when booting, it will show
A start job is running for hold until boot process finishes up (~min ~s/no limit)
. - The installation CD can still work.
I need to recover the system.
boot passwd
The following are the steps I destroyed my ubuntu:
- I installed Windows 10 and Ubuntu 18.04 in my computer;
- I modified the /etc/default/grub and set
GRUB_TIMEOUT = 0
, then I cannot see the Grub screen; (This is what I wanted.) - I modified the /etc/passwd and set
username:x:1000:1000::
to beusername:x:0:0::
, then the system asked me to create a new user when I reboot the system. (I intended to raise the privilege of the username.) - The result is that I cannot boot the system anymore.
- If I press ESC when booting, it will show
A start job is running for hold until boot process finishes up (~min ~s/no limit)
. - The installation CD can still work.
I need to recover the system.
boot passwd
boot passwd
edited Feb 26 at 12:25
terdon♦
133k32264443
133k32264443
asked Feb 26 at 11:48
haikhaik
1
1
2
Have you tried mounting the root filesystem using the installation CD and reverting/etc/passwd
?
– Torin
Feb 26 at 12:02
@Torin Thanks for your comment. I tried mounting it but I can only see the files under the directory of username. That is I cannot find the file/etc/passwd
.
– haik
Feb 26 at 12:05
1
Sounds like you have seperate partitions for home and root. There should be another mountable partition containing your root which will contain/etc/passwd
– Torin
Feb 26 at 12:11
And it's weird that when I runsudo chroot /mnt
, it will hintfailed to run command ‘/bin/bash’: No such file or directory
. But I indeed see the file/bin/bash
.
– haik
Feb 26 at 12:18
3
You're mounting the wrong filesystem then.
– Kusalananda
Feb 26 at 12:27
|
show 1 more comment
2
Have you tried mounting the root filesystem using the installation CD and reverting/etc/passwd
?
– Torin
Feb 26 at 12:02
@Torin Thanks for your comment. I tried mounting it but I can only see the files under the directory of username. That is I cannot find the file/etc/passwd
.
– haik
Feb 26 at 12:05
1
Sounds like you have seperate partitions for home and root. There should be another mountable partition containing your root which will contain/etc/passwd
– Torin
Feb 26 at 12:11
And it's weird that when I runsudo chroot /mnt
, it will hintfailed to run command ‘/bin/bash’: No such file or directory
. But I indeed see the file/bin/bash
.
– haik
Feb 26 at 12:18
3
You're mounting the wrong filesystem then.
– Kusalananda
Feb 26 at 12:27
2
2
Have you tried mounting the root filesystem using the installation CD and reverting
/etc/passwd
?– Torin
Feb 26 at 12:02
Have you tried mounting the root filesystem using the installation CD and reverting
/etc/passwd
?– Torin
Feb 26 at 12:02
@Torin Thanks for your comment. I tried mounting it but I can only see the files under the directory of username. That is I cannot find the file
/etc/passwd
.– haik
Feb 26 at 12:05
@Torin Thanks for your comment. I tried mounting it but I can only see the files under the directory of username. That is I cannot find the file
/etc/passwd
.– haik
Feb 26 at 12:05
1
1
Sounds like you have seperate partitions for home and root. There should be another mountable partition containing your root which will contain
/etc/passwd
– Torin
Feb 26 at 12:11
Sounds like you have seperate partitions for home and root. There should be another mountable partition containing your root which will contain
/etc/passwd
– Torin
Feb 26 at 12:11
And it's weird that when I run
sudo chroot /mnt
, it will hint failed to run command ‘/bin/bash’: No such file or directory
. But I indeed see the file /bin/bash
.– haik
Feb 26 at 12:18
And it's weird that when I run
sudo chroot /mnt
, it will hint failed to run command ‘/bin/bash’: No such file or directory
. But I indeed see the file /bin/bash
.– haik
Feb 26 at 12:18
3
3
You're mounting the wrong filesystem then.
– Kusalananda
Feb 26 at 12:27
You're mounting the wrong filesystem then.
– Kusalananda
Feb 26 at 12:27
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503117%2fubuntu-cannot-boot-after-modifying-etc-passwd%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503117%2fubuntu-cannot-boot-after-modifying-etc-passwd%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Have you tried mounting the root filesystem using the installation CD and reverting
/etc/passwd
?– Torin
Feb 26 at 12:02
@Torin Thanks for your comment. I tried mounting it but I can only see the files under the directory of username. That is I cannot find the file
/etc/passwd
.– haik
Feb 26 at 12:05
1
Sounds like you have seperate partitions for home and root. There should be another mountable partition containing your root which will contain
/etc/passwd
– Torin
Feb 26 at 12:11
And it's weird that when I run
sudo chroot /mnt
, it will hintfailed to run command ‘/bin/bash’: No such file or directory
. But I indeed see the file/bin/bash
.– haik
Feb 26 at 12:18
3
You're mounting the wrong filesystem then.
– Kusalananda
Feb 26 at 12:27