Professional Documents
Culture Documents
com/learning/how-to-reset-password-in-linux/
• Looking Glass
• Speed Test
• Developer Tools
• Status Page
Content Hub
• Blog
• Learning
• News
• Case studies
• Downloads
• Press & Media
• Product Roadmap
• Product Documentation
• API Documentation
• Help Center
Under attack?
Talk to an expert
en
• en
• de
en
• en
• de
• Products
Products
AI & Machine Learning
AI & Machine Learning
AI GPU CloudBare metal servers and virtual machines with NVIDIA A100 and H100 GPUs
AI Image GeneratorCreate realistic and stunning images from text descriptions in seconds with Gcore’s AI-powered tool
Speech-To-Text TranslationAI cloud and ML powered speech-to-text translation tool to translate English to Luxembourgish
Edge Network
Edge Network
Public DNSFast, secure, and free DNS resolver that protects your privacy.
Intel SGXInstances with Intel Software Guard Extensions designed to build secure enclave-based applications.
Cloud StorageS3/SFTP Storage for storing your data on our servers in Europe, the USA, and Asia.
Load BalancerTraffic distribution tool for increasing reliability and capacity of applications
Data MigrationMoving to our cloud without interruptions in the activity and zero data loss
1 of 7 2/16/24, 16:01
How to Reset Password in Linux | Step-by-step Guide https://gcore.com/learning/how-to-reset-password-in-linux/
Disaster RecoveryProtection of your business IT infrastructure from downtime in the event of failures and crashes
Cloud File SharesCreate, access, and share files remotely in the cloud
Veeam BackupVeeam Backup and recovery solutions to protect your business critical data and ensure business continuity
Managed KubernetesFully managed Kubernetes solution with no additional cost and rapid deployment
HostingVirtual and Dedicated servers in certified data centers around the world
Streaming PlatformInfrastructure for streaming video in your apps to 100M+ viewers and beyond
Video HostingMedia Platform by Gcore delivers video in 4K resolution to any device your viewers have
Real Time VideoModule for video calls and conferencing inside your web, iOS, and Android app
Computer VisionModule for objects recognition and video analysis based on machine learning
PricingStreaming Platform plans and cost estimation calculator for your case
Demo & ExamplesWatch live demo examples of our features and integrations
Security
Security
Secure Cloud ComputingGcore Secure Cloud Computing services help accelerate resilience in the public cloud by offering access to cloud security experts and strategies.
WAAPPowerfull all-in-one WAAP (Web Application and API Protection) solution against full spectrum of threats
Under Attack?If your website, server, or API is under attack — we are ready to help
Cloud for Mobile
Cloud for Mobile
IT Infrastructure ManagementServices that cover all the IT needs — from architecture planning to the operation of ready-made solutions
White Label ProgramWhite-label edge and cloud services ready-to-rock with your logo and branding
Premium SupportExperienced and friendly technical support specialists to assist in connecting, integrating, configuring and maintaining.
Solutions
By Industry
Gaming
◦ CDN for Gaming
◦ Game Server Protection
◦ Game Development
Media & Entertainment
◦ CDN for Video
◦ Video Hosting
◦ Live Streaming
◦ Video Calls
◦ Metaverse Streaming
◦ TV & Online Broadcasters
◦ Sport Broadcasting
◦ Online events
Financial Services
2 of 7 2/16/24, 16:01
How to Reset Password in Linux | Step-by-step Guide https://gcore.com/learning/how-to-reset-password-in-linux/
Partnership
White Label Program
Partners
Partners
Intel
Intel New CPU Generation
Intel Ice Lakes
HESP
Equinix
Graphcore
InData Labs
Ampere
Unum
Referral Program
Review Reward
Affiliate Program
Infrastructure for Startups
Bug Bounty Policy
• Company
Latest articles
Here you can find useful tips, features and solutions
NVIDIA GPUs: H100 vs. A100 | A Detailed Comparison
In 2022, NVIDIA released the H100, marking a significant addition to their GPU lineup. Designed to both complement and compete...
February 5, 2024
Running Kubeflow on Gcore Managed Kubernetes
In this tutorial, we’ll explore how to install and run Kubeflow on Gcore Managed Kubernetes. Kubeflow is an open-source toolkit...
January 26, 2024
All articles
Company
About Gcore
Compliance
Press & Media
Legal Information
Careers
Internet Peering Points
Events
Infrastructure
• Content Hub
Content Hub
Blog
Learning
News
Case studies
Downloads
Press & Media
API Documentation
Product Roadmap
Product Documentation
Help Center
• Tools
Tools
Looking Glass
Speed Test
Developer Tools
Status Page
• Talk to an expert
• Under attack?
3 of 7 2/16/24, 16:01
How to Reset Password in Linux | Step-by-step Guide https://gcore.com/learning/how-to-reset-password-in-linux/
Products:
Products:
• VPS Hosting
• Dedicated Servers
News
Blog
Learning
Press
Case Studies
Downloads
Events
1. Home
2. Learning
3. How to Reset Password in Linux
In this article
4 of 7 2/16/24, 16:01
How to Reset Password in Linux | Step-by-step Guide https://gcore.com/learning/how-to-reset-password-in-linux/
Forgetting a password can be a minor hiccup for most, but when it comes to Linux—a system known for its robust security features—it can feel like a daunting obstacle. Whether you’re new to the
world of open-source operating systems or a seasoned Linux veteran, resetting your password doesn’t have to be a complex chore. This guide offers a concise, step-by-step approach to help you
swiftly regain access to your Linux machine.
1. Access the GRUB menu. GRUB (Grand Unified Bootloader) is the default bootloader for most Linux distributions. First, restart or power on your computer. As soon as the boot process begins,
press and hold the Shift key (for some systems it might be the Esc key) to bring up the GRUB menu.
2. Enter the Edit Mode. Before booting into the system, you need to edit the boot parameters. First, highlight the default boot entry (usually the first in the list) using arrow keys.
3. Modify Boot Parameters. To boot into single-user mode, you need to modify the Linux boot parameters. Here are the following steps:
• Find the line that starts with linux or linux16. This line specifies the boot parameters.
• At this line, locate ‘ro quiet’, replace ‘ro’ to ‘rw’ then add the word single or init=/bin/bash, depending on your distribution and setup.
• Press Ctrl + X or F10 to boot with the modified parameters.
Here’s an example:
4. Remount the File System with Write Permissions. By default, the filesystem might be in read-only mode in this state. To change the password, you’ll need write permissions. Enter the
following command:
mount -n -o remount,rw /
5. Reset the Password. Use the passwd command to reset the password for a user. Enter the command below, replacing ‘username’ with the actual username for which you want to reset the
password:
passwd username
6. Reboot the System. Now that the password is reset, it’s best to reboot the system to return to normal operation. Enter the following command:
sync
reboot -f
The new password should now be active, and you can test it. In the following section, we’ll explore an alternative method using a live CD or USB.
1. Boot from the Live CD/USB. Insert your Live CD or USB stick. Reboot the computer and choose to boot from the CD/USB from the BIOS or UEFI boot menu.
2. Open a Terminal. Once the live environment is loaded, locate and open a terminal window.
3. Identify the System’s Root Partition. You can use tools like fdisk or lsblk to identify your system’s root partition.
sudo fdisk -l
# or
sudo lsblk -f
Look for partitions that are likely Linux root partitions, such as ext4, xfs, etc.
4. Mount the Root Partition. Create a mount point by running this command:
Mount the identified root partition (replace /dev/sdXY with your partition, for example, /dev/sda1):
5. Change Root into the System. Use chroot to change the root directory by using this command:
6. Reset the Password. Now that you’ve chrooted into your system, you can use the passwd command to change the password for any user, including root.
passwd username
Replace “username” with the actual username or use root to reset the root password.
5 of 7 2/16/24, 16:01
How to Reset Password in Linux | Step-by-step Guide https://gcore.com/learning/how-to-reset-password-in-linux/
7. Exit and Unmount. Exit the chroot environment and unmount the partition.
exit
sudo umount /mnt/myroot
8. Reboot. Remove the Live CD/USB and reboot your computer. Now, you should now be able to log in using the new password.
That’s it! You’re now able to reset passwords in Linux. To reset passwords, you can use either the GRUB method or a Live CD. The GRUB method is fast and doesn’t need external tools, but a Live
CD is more universal and works well for complex system setups or restricted GRUB access.
Conclusion
Looking to deploy Linux in the cloud? With Gcore Cloud, you can choose from Basic VM, Virtual Instances, or VPS/VDS suitable for Linux:
• Gcore Basic VM offers shared virtual machines from €3.2 per month
• Virtual Instances are virtual machines with a variety of configurations and an application marketplace
• Virtual Dedicated Servers provide outstanding speed of 200+ Mbps in 20+ global locations
Choose an instance
Related product
• AI Cloud Infrastructure
• Cloud Computing
• Platform as a Service
• 5G eSIM Platform
• Edge Network
• Video Streaming
• Security
• Hosting
Related articles
Share
•
•
•
Submit
We provide powerful solutions that will help your business grow globally. Try our superior performance for free.
Convenient cloud services with low latency around the world proven by the largest online businesses.
Products
• CDN
• DNS
• Hosting
• Streaming Platform
• Storage
• DDoS Protection
• Cloud
• IT Infrastructure Management
Company
• About
• Affiliate Program
• Referral Program
• Case Studies
• Careers
• Blog
• Learning
• Press
• Legal Information
• #SupportUkraine
Resources
• Status Page
• API Documentation
• Product Documentation
• Looking Glass
• Developer Tools
• Products Roadmap
6 of 7 2/16/24, 16:01
How to Reset Password in Linux | Step-by-step Guide https://gcore.com/learning/how-to-reset-password-in-linux/
• Help Center
Contact
• support@gcore.com
• info@gcore.com
• Report abuse
Sales
Email*
Submit
By clicking the button you give us an informed, specific and unambiguous consent to process your personal data in accordance with our Privacy policy
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
G-Core Labs S.A. © 2015–2024 All rights reserved. Principal place of business and postal address: 2-4, Rue Edmond Reuter, L-5326 Contern, Luxembourg
7 of 7 2/16/24, 16:01