Reset users password linux

Linux: Resetting a user’s password

Q. How do I reset a user’s password under any Linux distribution from command prompt?

A. To reset a user’s password, use passwd command. You have to change it to a different password.

Login as the root user

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Open terminal or shell prompt

Type the following command:
# passwd username
For example, reset a tom’s password, enter:
# passwd tom
Type a new password twice.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

forgot how to reset user’s password, and found here from google serach. It’s working. thanks!

Sir,
I introduce myself as I dont have knowledge of linux systems .But I want to learn LINUX.
I have a problem in a Digital Video Recorder Linux based embeded system which used HD for rrecording Video images.Os and applications are in the motherboard only.As I switch on the system, the screen shows INITIALISE and then the application starts itself.we cannot log into the admin of application to setup the system. The connected cameras are viewable.The user has lost or deleted the admin password.
Please guide me how to solve the problem. The system is working as normal except the admin login .I dont know the version of LINUX operating system.Or I need ghosting of program from one good system(I have another machine in good working status with password.

i was going to reset the root password and it doesen’t work it was saying somthing like control-d command and i can’t type in “passwd best”

i open help of yahoo site. i open how to change my password.
it open the page but my cursur does not work, it doesn’t type a single letter.
so many times i did it but it doesn’t go… please help.

I HAVE JUST BOUGHT ONE OF THESE SECOND HAND SO HOW DO I GET THE PASSWORD TO OPEN THINGS LIKE I DOWNLOADED GOOGLE CHROME AND IT ASKED FOR A PASSWORD

thank you so much.
i have a same problem.
i resolved with your help.

how to apply to multiple servers?

Hello sir,
This is XXX,I want kill other user’s processes in linux.
Anyone having idea about this,pls send solution.
Thx in advance……………………

their is no permissions to change the password even though if we change the password it gives changed successfully how come it can give in a normal user

How to allow permissions linux users to change their password them self?

i am unable to change the user password as a consign user id login.

]$ passwd
Changing password for user czfgbw.
Changing password for czfgbw
(current) UNIX password:
passwd: Authentication token manipulation error

I have run into an issue with forcing a user to change their password on first login onto a server where the user logs onto the server they are asked to enter their old password, then the new one. When they enter the new one, no matter what password they use, an message appears that states their password is a dictionary word and will not let them change it.
Is there a way to fix this??

UPDATE
Just type “passwd” without ” and follow on screen instructions

hey I did the procedure but the system replied saying there is a TOKEN conflict, ……. so I asked to myself…… what is this #%”#%, anybody please help. this is a call to the geek world.

I am not able to change the password, and since i cannot update (cause i need the password) I’m pretty much stuck, I got this laptop as a gift and the person who gave it to me forgot the admin password, and he deleted all updates and such, it’s so bad that not even flash player from adobe is installed, I need urgent help. I tried the things above but i am not able to type after i finally get to change the password, it just says its a token error. HELP

Nice! but do you know how to reset root password as normal user?

Источник

Как сбросить пароль в Linux


Давайте рассмотрим несколько способов сбрасывания системного пароля в Linux. Вы наверное знаете, что у пользователя root есть права на изменение пароля любого пользователя в системе. А что если вы забыли пароль от рута? Вот об этом и пойдет речь в статье.

При восстановления пароля (рута или любого другого пользователя) встречаются две различные ситуации, требующие разного подхода.

Когда можно использовать GRUB

    После этого вы либо увидите приглашение для рута, либо восстанавливающее меню, где нужно выбрать строку с рутом. Используйте passwd для того чтобы изменить пароль у любого пользователя

  • Выполните команду reboot для перезагрузки системы и затем авторизуйтесь с новым паролем
  • Также следует заметить что некоторые дистрибутивы создают режим восстановления во время установки. Если в вашем меню GRUB есть такой пункт, вам не нужно производить все вышеперечисленные действия, просто выберите режим восстановления, а затем приглашение для рута, в последующем диалоговом окне.

    Когда нет возможности использовать GRUB

    Если вы не используете GRUB по каким-то причинам, вы можете восстановить пароль с помощью live CD (Я буду использовать Ubuntu live CD, вы можете взять любой другой). Просто следуйте дальнейшим инструкциям:

    • Загрузитесь с live CD
    • Выберите «Попробовать Ubuntu без изменений на вашем компьютере» (Try Ubuntu without any changes to your computer)

  • Когда система будет готова, запустите окно терминала и приготовьтесь к выполнению некоторых действий в командной строке
  • Напечатайте в окне терминала sudo fdisk -l. В результате мы узнаем, в какой раздел диска установлен линукс и непосредственно имя самого жесткого диска, в представленном примере нужный нам раздел называется /dev/sda1 . Если вы точно знаете нужный раздел, этот шаг можно пропустить.

    Далее нам нужно монтировать линукс-раздел. Для этого создайте папку, в качестве точки для монтирования, используя команду: sudo mkdir /media/linx_part

    Примонтируйте линукс-раздел командой sudo mount /dev/sda1 /media/linx_part

  • Измените рута в примонтированном разделе — sudo chroot /media/sda1
  • Используйте passwd для изменения текущего пароля на новый

    Источник

    Как сбросить пароль Linux

    Бывают случаи, что вы забыли или просто не знаете пароль пользователя для входа в систему. Можно установить новый пароль для любого пользователя. Для этого у вас должен быть физический доступ к компьютеру. В данной статье мы рассмотрим, как сбросить пароль пользователя в Linux — как установить новый пароль.

    Первым делом нужно попасть в меню загрузчика GRUB. Для этого перезагрузите компьютер, и после того, как отобразится приветственный экран BIOS, нажмите и удерживайте клавишу Shift (или это может быть клавиша Esc ).

    Появится меню загрузчика GRUB. Если вдруг с первого раза не получилось, например, вы не успели нажать Shift, и меню GRUB не показалось, попробуйте перезагрузить компьютер еще раз.

    Меню GRUB выглядит следующим образом:

    В меню представлен список операционных систем, которые установлены и доступны для загрузки. Найдите ваш Linux-дистрибутив (скорее всего это будет первый пункт меню). Под этим пунктом будет следующий пункт меню — это либо Advanced options for Ubuntu или Ubuntu, with Linux . generic (recovery mode) . Вместо Ubuntu будет стоять название вашего дистрибутива. В моем случае это, например, elementary.

    Используя клавишу Вниз , выберете этот второй пункт в меню.

    Так как в моем случае это пункт с надписью Advanced options for . , то после его выбора появятся несколько новых пунктов. Нужно выбрать пункт с пометкой (recovery mode) .

    Появится новое меню — Recovery Menu. Используя клавишу Вниз , перейдите на пункт root (Drop to root shell promt) и выберите его, нажав клавишу Enter .

    Вы попадете в командную строку. Если появилось сообщение «Press Enter for maintenance», тогда нажмите Enter .

    Сейчас корневая файловая система примонтирована только для чтения. Смонтируем файловую систему так, чтобы иметь доступ на чтение и на запись. Для этого выполните команду:

    Теперь можно установить новый пароль для вашего пользователя. Для этого вы должны знать имя пользователя в системе. Если вы его не помните, то можно вывести список всех пользователей, выполнив команду (мое имя пользователя было последним в списке):

    Теперь установим новый пароль. Выполняем команду passwd в качестве аргумента для которой указываем имя пользователя, пароль которого мы хотим изменить (вместо yuriy укажите имя вашего пользователя):

    Появится запрос на ввод пароля. Обратите внимание, что при вводе пароля на экран ничего не выводится. Поэтому вводите пароль с клавиатуры, а затем просто нажимайте Enter . Далее пароль нужно будет ввести повторно.

    Теперь можно перезагрузить компьютер и попробовать войти в систему, используя новый пароль. Для перезагрузки введите команду:

    Видео — изменяем пароль пользователя

    В данном видео показаны все действия, описанные в статье — попадаем в меню GRUB, загружаем recovery mode, монтируем диск для записи и меняем пароль.

    Источник

    How to Reset the Root Password in Linux

    In Linux, regular users and superusers are allowed to access services via password authentication. In the case a regular user can’t remember his/her password, a superuser can reset the password of a regular user right from the terminal. However, what if the superuser (or root user) loses his/her password? They will have to recover the lost password prior to booting into the login screen. This allows any malicious user with physical access to your Linux host to gain complete ownership. This article takes a look at how to recover a lost root password in Linux using two different methods.

    Note: the method of resetting a root password is similar for most distros. Here we demonstrate the process using Ubuntu. We are also using “root password” throughout the tutorial for simplicity, but it can be interpreted interchangeably as the superuser password.

    Also read: How to Easily Rename Files in Linux

    1. Reset Lost Linux Root Password from the Grub Menu

    1. First and foremost, to recover a lost root password, we need to restart the Linux host, assuming you forgot the password for root.

    2. Once the GRUB page appears, quickly select the “*Advanced options for GNU/Linux” option by pressing the down arrow key and Enter button.

    3. Now press e to edit the commands.

    You need to modify it or change it from “read-only” mode to “read-write” mode. Find the line beginning with “Linux.” Look for ro and change it to rw . Add init=/bin/bash at the end of the line.

    4. Press F10 . This will display a screen with a prompt.

    5. Mount your root file system in read-write mode:

    6. You can now reset your lost root password by using the following command:

    Once you are done, type:

    This will exit the prompt and reboot the computer.

    Also read: How to Mount a Windows Share Folder on Linux

    2. Reset Lost Root Password Using Live CD

    If you have a Linux Live CD/USB, then you can boot into it and use it to reset the root password.

    1. Download the latest version of Ubuntu, and create a bootable Live CD/USB from it. Boot your system from the removable drive as opposed to your hard drive.

    2. On the display screen select “Try Ubuntu.” This will bring you to the Live CD desktop.

    3. Open the terminal and type the following command to become root:

    4. Find the location of the hard disk partition using the following command:

    In most cases it will be “/dev/sda1,” although it can differ depending on how your hard disk is partitioned.

    5. Mount the hard disk partition of the system to be recovered using the following command:

    6. At this point we need to jail ourselves in the “mnt/recovery” directory. This means that we are pretending to be on the regular Linux filesystem. This is simply known as chrooting.

    7. Use the following command to reset your Linux root password:

    8. Once completed, exit from the chroot shell:

    9. Unmount the root partition:

    and exit your root:

    10. Lastly, remove the Live CD and reboot into your Linux system.

    Changing the root password in Linux is easy once you get over the intimidation of the extra steps you have to take. Do note that anyone who has access to your computer can use this method to reset your superuser or root password. If you would like to be more cautious with who has access to these sorts of privileges, you should encrypt your hard disk so that it can’t be booted into or mounted easily.

    Frequently Asked Questions

    1. How does full disk encryption affect my ability to change my root password?

    Although encryption can complicate things when you’re trying to repair a problem on Linux, this is not the case when you’re trying to change the root password. You can still do it easily from grub as described above as long as you are able to gain access to the disk.

    The only difference now is that outsiders won’t be able to just slide in and do the same themselves.

    2. What is the difference between root and superuser password?

    In most cases, the root user is the same as the superuser. Changing the root password should also change the superuser password. In Ubuntu, the superuser is the one with User ID 0. If you have configured another user with the UID 0, then in this case, the root and superuser passwords are not the same.

    3. Can I create an expiration date for passwords?

    Yes, you can! Using the -x flag, you can set the lifespan for the password of a particular user. For example, typing passwd -x 30 root will make the root password valid for only 30 days. Upon expiration, you must change the password.

    Additionally, you could use the -w flag to set the number of days required for an advanced warning about the need to change the password . Typing passwd -w 7 root will send you warnings about changing the root password a week prior to the deadline you previously set with the -x flag.

    Want to keep digging into Linux? We have a guide for setting up Bluetooth on Linux. You can also check out our list of tools to create your very own Linux distro!

    Miguel has been a business growth and technology expert for more than a decade and has written software for even longer. From his little castle in Romania, he presents cold and analytical perspectives to things that affect the tech world.

    Источник

    Читайте также:  Python работа с регистром windows
  • Оцените статью