{"id":172,"date":"2011-02-03T13:25:55","date_gmt":"2011-02-03T13:25:55","guid":{"rendered":"http:\/\/blogs.silicontechnix.com\/?p=172"},"modified":"2011-03-02T07:53:05","modified_gmt":"2011-03-02T07:53:05","slug":"how-to-reset-root-or-any-users-password-in-linux-distro","status":"publish","type":"post","link":"https:\/\/blogs.silicontechnix.com\/?p=172","title":{"rendered":"How To Reset ROOT (or any user&#8217;s) Password in Linux distro"},"content":{"rendered":"<p>The root user can change the password for any other user. However what if you forget your root password?<\/p>\n<p>To reset your root password (or any other account&rsquo;s password for that matter), there are essentially two different situations which require varying approaches<\/p>\n<h5><strong><strong>When you can use Boot Loaders (GRUB \/ LILO)<br \/>\n\t<\/strong><\/strong><\/h5>\n<p>If you have GRUB installed and you have accesses to edit boot parameters of selected entries then the job is as easy as it can get. Follow along and you shall have root access in no time. Once you have root access you can pretty much do anything you want to do!<\/p>\n<ul>\n<li>Highlight the GRUB entry for the Linux installation that you want to reset the password for.<\/li>\n<li>Press &lsquo;e&rsquo; to edit. Select the Kernel line. Add &lsquo;<strong>single<\/strong>&rsquo; at the end of the kernel line, Press ENTER and then Press &lsquo;b&rsquo; to boot. If your system still requires you to enter the root password, add <strong>init=\/bin\/bash<\/strong> at the end. Press &lsquo;b&rsquo; to boot.<\/li>\n<li>Please note in some distros &#39;<strong>single<\/strong>&#39; can be, &#39;<strong>linux single<\/strong>&#39; , &#39;<strong>run level 1<\/strong>&#39; etc.<\/li>\n<\/ul>\n<h3><a href=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=173\" rel=\"attachment wp-att-173\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"181\" data-attachment-id=\"173\" data-permalink=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=173\" data-orig-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/grub1.png\" data-orig-size=\"540,326\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"grub1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/grub1-300x181.png\" data-large-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/grub1.png\" alt=\"GRUB Boot Loader\" class=\"alignnone size-medium wp-image-173\" src=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/grub1-300x181.png\" style=\"width: 399px; height: 246px;\" title=\"grub1\" srcset=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/grub1-300x181.png 300w, https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/grub1.png 540w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h3>\n<ul>\n<li>Either you would be taken to the root prompt directly or shown the recovery menu from where you can choose the root prompt. Use <strong>passwd &lt;username&gt;<\/strong> to change the password for any account.<\/li>\n<li>Type <strong>reboot<\/strong> to reboot the system and then log in in with your new password.<\/li>\n<\/ul>\n<h5><strong><strong>When you can&rsquo;t use Boot Loaders<br \/>\n\t<\/strong><\/strong><\/h5>\n<p>If you are unable to use GRUB for whatever reasons (like password protected entries) you can still reset the password using a Live CD (I will be using Ubuntu Live CD, you may use any other). Just follow the steps below to achieve this:<\/p>\n<ul>\n<li>Boot from the Live CD <a href=\"http:\/\/www.ubuntu.com\/desktop\/get-ubuntu\/download\">(Download Link)<\/a> (Aslo you can try <span style=\"font-weight: bold;\">USB <\/span><strong>drive to boot<\/strong> after downloading <strong>.ISO<\/strong> file, <a href=\"http:\/\/www.pendrivelinux.com\/universal-usb-installer-easy-as-1-2-3\/\">try this<\/a>)<\/li>\n<li>Choose <a href=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=174\" rel=\"attachment wp-att-174\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"174\" data-permalink=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=174\" data-orig-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/tryubuntu.png\" data-orig-size=\"540,381\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"ubuntu desktop\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/tryubuntu-300x211.png\" data-large-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/tryubuntu.png\" alt=\"\" class=\"alignnone size-medium wp-image-174\" height=\"211\" src=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/tryubuntu-300x211.png\" title=\"ubuntu desktop\" width=\"300\" srcset=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/tryubuntu-300x211.png 300w, https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/tryubuntu.png 540w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a> <br \/>\n\t\t&ldquo;<strong>Try Ubuntu without any changes to your computer<\/strong>&rdquo;&nbsp;<\/li>\n<li>When the system is ready, fire up a terminal window (<strong>CTRL+ALT+F1<\/strong>) and get ready for some command line action<\/li>\n<li>Type <strong>sudo fdisk -l<\/strong>. <a href=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=175\" rel=\"attachment wp-att-175\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"84\" data-attachment-id=\"175\" data-permalink=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=175\" data-orig-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/fdisk.jpg\" data-orig-size=\"653,183\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"fdisk\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/fdisk-300x84.jpg\" data-large-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/fdisk.jpg\" alt=\"\" class=\"alignnone size-medium wp-image-175\" src=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/fdisk-300x84.jpg\" style=\"width: 344px; height: 99px;\" title=\"fdisk\" srcset=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/fdisk-300x84.jpg 300w, https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/fdisk.jpg 653w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a> <br \/>\n\t\tIn the output we are concerned to know which partition Linux is installed on and what name the hard disk is using. (e.g) in my case it is <strong>\/dev\/sda1<\/strong> is the required partition. If you are sure about the partition you can skip this step<\/li>\n<li>Next we need to mount the Linux partition. Create a directory to act as mount point for the partition. Use &lsquo;<strong>sudo mkdir \/media\/masterdrive<\/strong>&lsquo; <a href=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=176\" rel=\"attachment wp-att-176\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"176\" data-permalink=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=176\" data-orig-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mkdir.jpg\" data-orig-size=\"325,31\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"mkdir\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mkdir-300x28.jpg\" data-large-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mkdir.jpg\" alt=\"\" class=\"alignnone size-medium wp-image-176\" height=\"28\" src=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mkdir-300x28.jpg\" title=\"mkdir\" width=\"300\" srcset=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mkdir-300x28.jpg 300w, https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mkdir.jpg 325w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Mount the linux partition using the command &lsquo;<strong>sudo mount \/dev\/sda1 \/media\/masterdrive<\/strong>&lsquo;<a href=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=177\" rel=\"attachment wp-att-177\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"177\" data-permalink=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=177\" data-orig-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mount.jpg\" data-orig-size=\"405,31\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"mount\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mount-300x22.jpg\" data-large-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mount.jpg\" alt=\"\" class=\"alignnone size-medium wp-image-177\" height=\"22\" src=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mount-300x22.jpg\" title=\"mount\" width=\"300\" srcset=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mount-300x22.jpg 300w, https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/mount.jpg 405w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Change Root to the mount directory &ndash; &lsquo;<strong>sudo chroot \/media\/masterdrive<\/strong>&lsquo; <a href=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=178\" rel=\"attachment wp-att-178\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"178\" data-permalink=\"https:\/\/blogs.silicontechnix.com\/?attachment_id=178\" data-orig-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/chroot.jpg\" data-orig-size=\"413,32\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"chroot\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/chroot-300x23.jpg\" data-large-file=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/chroot.jpg\" alt=\"\" class=\"alignnone size-medium wp-image-178\" height=\"23\" src=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/chroot-300x23.jpg\" title=\"chroot\" width=\"300\" srcset=\"https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/chroot-300x23.jpg 300w, https:\/\/blogs.silicontechnix.com\/wp-content\/uploads\/2011\/02\/chroot.jpg 413w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n\t\t(if no \/bin\/bash error, then try other partition=&gt; sudo fdisk -l)<\/li>\n<li>Type <strong>sudo passwd<\/strong> and then enter the new password to change the root password.<\/li>\n<li>OR type <strong>password &lt;username&gt;<\/strong> for anyother user<\/li>\n<li>Type <strong>sudo reboot<\/strong> to restart the system.<\/li>\n<li>You just recovered your <strong>root <\/strong>password.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The root user can change the password for any other user. However what if you forget your root password? To reset your root password (or any other account&rsquo;s password for that matter), there are essentially two different situations which require varying approaches When you can use Boot Loaders (GRUB \/ LILO) If you have GRUB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[17,95],"tags":[88,85,86,83,19,81,89,76,80,90,79,78,77,82,87,84],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-security","category-system-administration","tag-binbash","tag-chroot","tag-fdisk","tag-grub","tag-linux","tag-live-cd","tag-mount","tag-password","tag-password-reset","tag-recovery","tag-recovery-cd","tag-reset","tag-root","tag-root-password","tag-ubuntu","tag-usb-boot"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p12j6H-2M","_links":{"self":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":12,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions\/219"}],"wp:attachment":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}