3 added 5 characters in body
source | link

recoveryRecovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

    connect to the console of your VM, using virtual box.

  2. a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

    b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash to kernel line.

  3. remount / and /usr, then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /etc/passwd # see bellow
    vi /fire/wall/rules # (sic)
    
    reboot
    

2.a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

2.b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash to kernel line.

  1. remount / and /usr , then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /etc/passwd # see bellow
    vi /fire/wall/rules # (sic)
    
    reboot
    

lost root password ?

to recover a lost root password, once you are in step 3.

  • passwd root
  • vi /etc/shadow, edit line like root:$6:salt$crypted:... remove $6$... up to but not including : (this will allow login with no password).

recovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

2.a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

2.b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash to kernel line.

  1. remount / and /usr , then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /etc/passwd # see bellow
    vi /fire/wall/rules # (sic)
    
    reboot
    

lost root password ?

to recover a lost root password, once you are in step 3.

  • passwd root
  • vi /etc/shadow, edit line like root:$6:salt$crypted:... remove $6$... up to but not including : (this will allow login with no password).

Recovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

  2. a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

    b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash to kernel line.

  3. remount / and /usr, then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /etc/passwd # see bellow
    vi /fire/wall/rules # (sic)
    
    reboot
    

lost root password ?

to recover a lost root password, once you are in step 3.

  • passwd root
  • vi /etc/shadow, edit line like root:$6:salt$crypted:... remove $6$... up to but not including : (this will allow login with no password).
2 added 290 characters in body
source | link

recovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

2.a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

2.b. if you cancan't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bashinit=/bin/bash to kernel line.

  1. remount / and /usr , then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /etc/passwd # see bellow
    vi /fire/wall/rules # (sic)
    
    reboot
    

lost root password ?

to recover a lost root password, once you are in step 3.

  • passwd root
  • vi /etc/shadow, edit line like root:$6:salt$crypted:... remove $6$... up to but not including : (this will allow login with no password).

recovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

2.a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

2.b. if you can log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash

  1. remount / and /usr , then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /fire/wall/rules # (sic)
    
    reboot
    

recovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

2.a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

2.b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash to kernel line.

  1. remount / and /usr , then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /etc/passwd # see bellow
    vi /fire/wall/rules # (sic)
    
    reboot
    

lost root password ?

to recover a lost root password, once you are in step 3.

  • passwd root
  • vi /etc/shadow, edit line like root:$6:salt$crypted:... remove $6$... up to but not including : (this will allow login with no password).
1
source | link

recovery is similar to a lost root password (and might be easiest).

  1. connect to the console of your VM, using virtual box.

2.a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.

2.b. if you can log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add init=/bin/bash

  1. remount / and /usr , then edit sshd_config

    mount -o remount,rw /
    mount /usr
    
    vi /etc/ssh/sshd_config
    vi /fire/wall/rules # (sic)
    
    reboot