Сброс пароля root suse linux

SecurID ® Governance & Lifecycle Knowledge Base

Find answers to your questions and identify resolutions for known issues with knowledge base articles written by SecurID Governance & Lifecycle experts.

  • RSA Community
  • :
  • Products
  • :
  • RSA Governance & Lifecycle
  • :
  • Knowledge Base
  • :
  • How to reset the root user password on an SUSE Linux Enterprise Server (SLES) hardware appliance in .

How to reset the root user password on an SUSE Linux Enterprise Server (SLES) hardware appliance in RSA Identity Governance & Lifecycle

Article Number

Applies To

RSA Product Set: RSA Identity Governance & Lifecycle
RSA Product/Service Type: Hardware Appliance
RSA Version/Condition : 6.x, 7.x
O/S Version: SUSE Linux Enterprise Server (SLES) 11 SP2 / SP3

Issue

This RSA Knowledge Base Article provides steps for resetting the root user password on an RSA Identity Governance & Lifecycle SUSE Linux Enterprise Server (SLES) hardware appliance.

Resolution

  1. After powering on the system, you will see the graphical SUSE Linux selection screen that lets you choose between Standard , Failsafe , and Floppy boot. As soon as you are presented with this menu, press the down arrow key to stop the countdown, then press the up arrow key to have the top choice highlighted.
  2. With the top selection highlighted, type init=/bin/sh which will be appended to the Boot Options line near the bottom of the screen. An example of how this will look is shown below. Note the contents of the Boot Options line has init=/bin/sh appended.

  1. Now press enter to boot the Operating System.
  2. Once you are given a shell prompt, execute the following commands:

 lvm vgscan -v mount /dev/system/root /mnt mount --bind /dev /mnt/dev chroot /mnt passwd root

  1. You will be prompted to set a password for root and to confirm the password after which, run these additional commands.

Your root password is now set to the value you provided at the prompt. Here is a screenshot of the procedure having been performed using the above commands:

Источник

Русские Блоги

Если вы случайно забыли пароль root и не можете войти в систему, вы слышали о входе в однопользовательский режим для изменения пароля, но это относится только к redhat linux, а не к SUSE linux, SUSE все равно попросит вас войти в однопользовательский режим Пароль root. Для SUSE linux, если вы забыли пароль root, попробуйте следующий метод изменения пароля root.

1. Запустите систему. При загрузке в меню загрузки grub найдите текущий элемент загрузки системы (вы можете нажать клавиши со стрелками, чтобы раскрыть скрытое меню). Установите курсор на эту опцию и нажмите клавишу с буквой «e», чтобы войти в это состояние управляемого редактирования.

2. Эта опция состоит из трех строк. Используйте курсор, чтобы выбрать вторую строку, которая начинается с «Ядро».

3. Еще раз нажмите букву «e» в этой строке, чтобы войти в состояние редактирования этой строки. И добавьте init = / bin / bash в конец строки.

4. После внесения изменений нажмите «Enter», чтобы вернуться к исходному интерфейсу. Нажмите клавишу с буквой «b», чтобы начать загрузку. Через некоторое время появится (нет): / # interface

5. Введите mount -n / -o remount, rw

6. Введите / usr / bin / passwd, чтобы сбросить пароль root.

7. После завершения модификации введите mount -n / -o remount, ro, чтобы установить корневую файловую систему в исходное состояние.

8. Введите exit, чтобы выйти из системы, перезапустите систему и войдите в систему с новым паролем.

Источник

SDB:Recover root password

If you’ve lost your root password, you might be able to recover it using the steps below. However, some systems are protected with boot loader passwords that will not let you do that without that password. If the boot loader is password protected, you need to boot from other media Like the OpenSUSE CD/DVD/mini-boot. The openSUSE install DVD is probably the best one to use.

CD/DVD/USB recovery mode

If using CD/DVD/USB boot media, You need to choose Rescue System. You enter root and then mount the disk manually. For example, a Compaq raid controller will probably be /dev/ida/c0d0 or an ATA drive will be /dev/sda1. Find the partitions by using fdisk -l /dev/ida/c0d0 or fdisk -l /dev/sda and then mount what you need.

# mount -o remount,rw /dev/sda1 /mnt
# cd /mnt # chroot /mnt # passwd

10.3 changed chroot to need more steps:

# mount -o bind /proc /mnt/proc # mount -o bind /sys /mnt/sys # mount -o bind /dev /mnt/dev # chroot /mnt # mount -a # passwd

You are now root in the installed sytem, with all at hand: passwd, and also YaST.

«bind» allows using two mount points for system virtual folders.

If all fails, consider that you can pull this drive (or install another drive in this machine) and mount it from another running Linux. Then recover the root password as explained above.

Single user mode

The first thing to try is to boot to single user mode. This might not work for you, because your system might be configured to still ask for a root password to get to single user mode. If that’s the case, we’ll use another trick that replaces init with /bin/bash.

First, try single user. If you don’t see either a LILO or GRUB boot screen, try hitting CTRL-X to get one. If it’s LILO, just type «linux single» and that should do it (assuming that «linux» is the lilo label). If text mode GRUB, hit ‘e», then select the «kernel» line, hit «e» again, and add » single» (or just » 1″) to the end of the line. Press ENTER, and then «b» to boot. (Newer version of grub uses «a» to append to the boot line). If using graphical Grub, just append 1 or single on the edit line.

You should get a fairly normal looking boot sequence except that it terminates a little early at a bash prompt. If you get a «Give root password for system maintenance», this isn’t going to work, so see the «init or /bin/bash» version below.

If you do get the prompt, the / filesystem may not be mounted rw (although «mount» may say it is). Do:

If that doesn’t work (it might not), just type «mount» to find out where «/» is mounted. Let’s say it is on /dev/sda2. You’d then type:

mount -o remount,rw /dev/sda2

If you can do this, just type «passwd» once you are in and change it to whatever you like. Or just edit /etc/shadow to remove the password field: move to just beyond the first «:» and remove everything up to the next «:». With vi, that would be «/:» to move to the first «:», space bar once, then «d/:» and ENTER. You’ll get a warning about changing a read-only file; that’s normal. Before you do this, /etc/shadow might look like:

root:$1$8NFmV6tr$rT.INHxDBWn1VvU5gjGzi/:12209:0:99999:7:-1:-1:1074970543 bin:*:12187:0:99999:7. daemon:*:12187:0:99999:7. adm:*:12187:0:99999:7.

and after, the first few lines should be:

root::12209:0:99999:7:-1:-1:1074970543 bin:*:12187:0:99999:7. daemon:*:12187:0:99999:7. adm:*:12187:0:99999:7.

You’ll need to force the write: with vi, «:wq!». (If that still doesn’t work, you needed to do the -o remount,rw, above).

INIT or /bin/bash mode

Another trick is to add «init=/bin/bash» (LILO «linux init=/bin/bash» or add it to the Grub «kernel» line). This will dump you to a bash prompt much earlier than single user mode, and a lot less has been initialised, mounted, etc. You’ll definitely need the «-o remount,rw» here. Also note that other filesystems aren’t mounted at all, so you may need to mount them manually if you need them. Look in /etc/fstab for the device names.

Keep this in mind if you have a Linux machine in a publically accessible place : without more protection, it’s not usually hard to recover a lost root password, which means it’s just as easy for someone to CHANGE it, or access root without your knowledge.

Another way to do this is to remove the password from /etc/shadow. Just in case you screw up, I’d copy it somewhere safe first. You want to end up with the root line looking something like this:

root:$1$EYBTVZHP$QtjkCG768giXzPvW4HqB5/:12832:0:99999:7.

If you are having trouble with editing (you really do have to learn vi one of these days), you could just (after making a copy, of course) just

echo "root::12832:0. " > /mnt/etc/shadow

or, if you were in single user mode

echo "root::12832:0. " > /etc/shadow

and then fix things up when rebooted.

Источник

How To: Recover the Linux root password

This document (3003803) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 9
SUSE Linux Enterprise Server 8

Situation

Resolution

  1. Boot server from the installation CD.
  2. Then select any installation method or Rescue System.
  3. At the first installation screen when selecting language, press ctrl-alt-f2 to open a virtual console. Note: If you selected Rescue System, select your keyboard language and then a Rescue Login prompt should appear. Login as root .
  4. Type

Additional Information

The command » mount-rootfs-and-do-chroot.sh » has been added to the rescue system of later versions of SUSE Linux Enterprise to ease the process of mounting the root device as well as the proc, sys and dev directories. The script is used as follows below:

1.) mount-rootfs-and-do-chroot.sh , e.g.: mount-rootfs-and-do-chroot.sh /dev/sda4 or in case the root device resides on a LVM device: mount-rootfs-and-do-chroot.sh /dev/rootvg/root 2.) mount -a

The mount -a command inside the chroot environment ensures all other filesystems specified in /etc/fstab are mounted as well.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented «AS IS» WITHOUT WARRANTY OF ANY KIND.

Оцените статью
Adblock
detector