ubuntu cannot boot after modifying /etc/passwd

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















The following are the steps I destroyed my ubuntu:



  1. I installed Windows 10 and Ubuntu 18.04 in my computer;

  2. I modified the /etc/default/grub and set GRUB_TIMEOUT = 0, then I cannot see the Grub screen; (This is what I wanted.)

  3. I modified the /etc/passwd and set username:x:1000:1000:: to be username: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.)

  4. The result is that I cannot boot the system anymore.

  5. 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).

  6. The installation CD can still work.

I need to recover the system.










share|improve this question



















  • 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 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





    You're mounting the wrong filesystem then.

    – Kusalananda
    Feb 26 at 12:27















0















The following are the steps I destroyed my ubuntu:



  1. I installed Windows 10 and Ubuntu 18.04 in my computer;

  2. I modified the /etc/default/grub and set GRUB_TIMEOUT = 0, then I cannot see the Grub screen; (This is what I wanted.)

  3. I modified the /etc/passwd and set username:x:1000:1000:: to be username: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.)

  4. The result is that I cannot boot the system anymore.

  5. 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).

  6. The installation CD can still work.

I need to recover the system.










share|improve this question



















  • 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 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





    You're mounting the wrong filesystem then.

    – Kusalananda
    Feb 26 at 12:27













0












0








0








The following are the steps I destroyed my ubuntu:



  1. I installed Windows 10 and Ubuntu 18.04 in my computer;

  2. I modified the /etc/default/grub and set GRUB_TIMEOUT = 0, then I cannot see the Grub screen; (This is what I wanted.)

  3. I modified the /etc/passwd and set username:x:1000:1000:: to be username: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.)

  4. The result is that I cannot boot the system anymore.

  5. 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).

  6. The installation CD can still work.

I need to recover the system.










share|improve this question
















The following are the steps I destroyed my ubuntu:



  1. I installed Windows 10 and Ubuntu 18.04 in my computer;

  2. I modified the /etc/default/grub and set GRUB_TIMEOUT = 0, then I cannot see the Grub screen; (This is what I wanted.)

  3. I modified the /etc/passwd and set username:x:1000:1000:: to be username: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.)

  4. The result is that I cannot boot the system anymore.

  5. 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).

  6. The installation CD can still work.

I need to recover the system.







boot passwd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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





    You're mounting the wrong filesystem then.

    – Kusalananda
    Feb 26 at 12:27












  • 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 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





    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










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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?