Не меняется пароль root в Centos 7

Ваш man cutописывает параметр -n как "игнорируемый" просто потому, что он не реализован в реализации cutиз coreutils.

Тем не менее, опция -n реализована на некоторых других cutреализациях, по крайней мере, в реализации *BSD\POSIX.2 (s ).

Таким образом, cutиз coreutils реализует для него заглушку, ради переносимости, чтобы не нарушать совместимость со сценариями. Однако, поскольку он не реализован, его использование не будет иметь никакого эффекта.

Из man cutв FreeBSD 12.0:

-n Do not split multi-byte characters. Characters will only be output if at least one byte is selected, and, after a prefix of zero or more unselected bytes, the rest of the bytes that form the character are selected.

Со страницы стандарта POSIX cut, ссылка указана @Kusalananda:

-n Do not split characters. When specified with the -b option, each element in list of the form low- high ( -separated numbers) shall be modified as follows:

If the byte selected by low is not the first byte of a character, low shall be decremented to select the first byte of the character originally selected by low. If the byte selected by high is not the last byte of a character, high shall be decremented to select the last byte of the character prior to the character originally selected by high, or zero if there is no prior character. If the resulting range element has high equal to zero or low greater than high, the list element shall be dropped from list for that input line without causing an error.

Each element in list of the form low- shall be treated as above with high set to the number of bytes in the current line, not including the terminating. Each element in list of the form - high shall be treated as above with low set to 1. Each element in list of the form num (a single number) shall be treated as above with low set to num and high set to num.

-3
13.09.2021, 08:20
1 ответ

Попробуйте сбросить пароль root с помощью командной строки grub:

  1. Нажмите eв меню grub, чтобы отредактировать команду загрузки.
  2. Обновите начало строки на linux16и замените параметр roна rw init=/sysroot/bin/sh
  3. .
  4. Нажмите Control+xдля запуска в однопользовательском режиме
  5. После загрузки вы вошли в систему как пользователь root. Введите chroot /sysroot, чтобы смонтировать корневую файловую систему.
  6. Обновите пароль root с помощью команды passwdи введите новый пароль root. Я предлагаю установить очень простой пароль.
  7. Запустите команду touch /.autorelabel, чтобы обновить SELinux.
  8. Затем введите exitи, наконец, перезагрузите систему с помощью reboot.

После перезагрузки вы можете войти в систему как root с паролем, установленным на шаге 5.

2
13.09.2021, 09:25

Теги

Похожие вопросы