Reset Passwords and SSH Keys in Fedora CoreOS
source link: https://www.vultr.com/docs/reset-passwords-and-ssh-keys-in-fedora-coreos
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Using a Different System?
- Reset Windows Server Administrator Password
- Reset the Root Password on CentOS
- Reset the Root Password on Fedora
- Reset the Root Password on CoreOS
- Reset the Root Password on Debian
- Reset the Root Password on FreeBSD
- Reset the Root Password on Ubuntu
- Reset the Root Password on OpenBSD
- Reset the Root Password on AlmaLinux
- Reset the Root Password on Rocky Linux
- Reset the Root Password on VzLinux
- Reset the Root Password on Arch Linux
- How to Reset the Root Password in Single-User Mode
Introduction
Use these steps if you are locked out of your Fedora CoreOS instance or need to change passwords or SSH keys. You must boot into single-user mode to regain access.
1. Boot in Single User Mode
Access the instance console in the Vultr customer portal.
Click the Send CtrlAltDel button on the top right of the web console.
You can also click the Server Restart icon.
As the system boots, press E to edit the GRUB boot options. This happens quickly, you have approximately one second to intercept the boot process. If you miss the prompt, restart the server and try again.
- Find the kernel line starting with
linux
. Remove the console option that reads
console=ttyts0,115200n8
.Add
single
to the end of the kernel line.Press CTRL+X to start.
The system will boot to rescue mode. Press ENTER for single-user (maintenance) mode.
2. Change the Core User Password
As root, use the
passwd
utility to change the core user password.# passwd core Changing password for user core. New password: Retype new password: passwd: all authentication tokens updated successfully.
Reboot the system:
# /sbin/reboot -f
3. Change the Core User SSH key
- Log in with the web console as core with the new password.
Add a new public key to
~/.ssh/authorized_keys.d/
. Choose a logical filename for the key.📝 Note: The web console does not support copy and paste. The easiest method is to upload the key to a public site, then use
curl
. Delete the key from the website when finished.$ curl https://example.com/id_rsa.pub >> ~/.ssh/authorized_keys.d/new_public_key
Set the permissions for the new public key.
$ chmod 600 ~/.ssh/authorized_keys.d/new_public_key
Recommended: Lock the core user password.
$ sudo passwd -l core passwd: success
Log out of the web console.
- Log in as core via SSH with your new key.
Want to contribute?
You could earn up to $600 by adding new articles
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK