Giter Site home page Giter Site logo

lesson4-boot_system's Introduction

lesson4-Boot_system

попасть в систему без пароля

1 способ init=/bin/sh

изменяем параметры загрузки контекстного меню выбора загрузки ядра в GUI

  • удаляем параметр загрузки ядра console=ttyS0,115200n8
  • добавляем параметры selinux=0 init=/bin/sh

2 способ rd.break

изменяем параметры загрузки контекстного меню выбора загрузки ядра в GUI

  • удаляем параметр загрузки ядра console=ttyS0,115200n8
  • добавляем параметры selinux=0 rd.break
    после загрузки систему можно изменить пароль администратора
    mount -o remount,rw /sysroot
    chroot /sysroot
    passwd root вводим пассворд с подтверждением и проверяем перезагрузившись

3 способ rw init=/sysroot/bin/sh

изменяем параметры загрузки контекстного меню выбора загрузки ядра в GUI

  • удаляем параметр загрузки ядра console=ttyS0,115200n8
  • добавляем параметры selinux=0 init=/sysroot/bin/sh
  • изменяем ro на rw

Установить систему с LVM и переименовать VG

  • Проверяем состояние системы командой vgs
    VG #PV #LV #SN Attr VSize VFree
    VolGroup00 1 2 0 wz--n- <38.97g 0
  • переименовываем VolGroup
    vgrename VolGroup00 OtusRoot
    далее меняем значения в файлах /etc/fstab /etc/default/grub /boot/grub2/grub.cfg
    выполняем
    mkinitrd -f -v /boot/initramfs-$(uname -r).img $(uname -r)
  • перезагружаемся и проверяем vgs
    VG #PV #LV #SN Attr VSize VFree
    OtusRoot 1 2 0 wz--n- <38.97g 0

добавление модуля в загрузку

создаем папку /usr/lib/dracut/modules.d/01test с файлами test.sh и modules-setup.sh
Пересобираем образ initrd
dracut -f -v
редактируем grub.cfg, удаляем параметры загрузки rghb и quiet
после перезагрузки увидим отображение пингвина в терминале.

< I'm dracut module >
  > -------------------
  > \
 > \
    .--.
   |o_o |
   |:_/ |
  //   \ \
 (|     | )
/'\_   _/`\
\___)=(___/

lesson4-boot_system's People

Contributors

hanafeevrus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.