Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How can i reset root password and disable ufw via Kimsufi Rescue mode?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How can i reset root password and disable ufw via Kimsufi Rescue mode?

postcdpostcd Member
edited May 2017 in Help

Hello,

after command "sudo ufw enable", Kimsufi server become inaccessible.
In Rescue mode there is:

df -h

Filesystem Size Used Avail Use% Mounted on

devtmpfs 2.0G 0 2.0G 0% /dev

178.33.124.49:/home/pub/rescue.v8 1.9T 249G 1.6T 14% /nfs

tmpfs 2.0G 2.0M 2.0G 1% /rw

aufs 2.0G 2.0M 2.0G 1% /

178.33.124.49:/home/pub/pro-power 1.9T 249G 1.6T 14% /power

178.33.124.49:/home/pub/commonnfs 1.9T 249G 1.6T 14% /common

tmpfs 2.0G 0 2.0G 0% /dev/shm

tmpfs 2.0G 9.7M 2.0G 1% /run

tmpfs 5.0M 0 5.0M 0% /run/lock

tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup

tmpfs 2.0G 68K 2.0G 1% /tmp

How and which partition i need to mount/chroot/make writeable please?

What i should do so ufw is disabled at reboot and server can be connected again please?

Comments

  • VitaVita Member

    Do a fdisk -l

  • postcdpostcd Member

    thx for help. I tried to follow instructions at https://askubuntu.com/a/28100/456366

    sudo mount /dev/sda1 /mnt

    sudo mount --bind /dev /mnt/dev

    sudo mount --bind /proc /mnt/proc

    sudo mount --bind /sys /mnt/sys

    cp /etc/resolv.conf /mnt/etc/resolv.conf

    sudo chroot /mnt

    apt-get purge ufw

    exit

    sudo umount /mnt/sys

    sudo umount /mnt/proc

    sudo umount /mnt/dev

    sudo umount /mnt

    reboot

    and now server is accepting SSH connections..

  • postcdpostcd Member

    @Vita said:
    Do a fdisk -l

    Device Boot Start End Sectors Size Id Type

    /dev/sda1 * 4096 40962047 40957952 19.5G 83 Linux

    /dev/sda2 40962048 77111295 36149248 17.2G 83 Linux

    /dev/sda3 77111296 78157823 1046528 511M 82 Linux swap / Solaris

  • Lol.. Install webmin or other server management tool before you messing with firewall setting

  • VitaVita Member

    @postcd said:

    @Vita said:
    Do a fdisk -l

    Device Boot Start End Sectors Size Id Type

    /dev/sda1 * 4096 40962047 40957952 19.5G 83 Linux

    /dev/sda2 40962048 77111295 36149248 17.2G 83 Linux

    /dev/sda3 77111296 78157823 1046528 511M 82 Linux swap / Solaris

    I see you solved the problem. Fdisk showed you three partitions that you could mount. So you could use the

    mkdir /mnt/somefolder

    mount /dev/sdaX /mnt/somefolder

    Replace the X with the partiton you wanted to mount.

    Best regards!

    Thanked by 1postcd
  • teamaccteamacc Member

    Not sure about root pass, there should be plenty of stuff about that on the web.

    UFW stores its rules in /etc/ufw/ufw.conf, ENABLED=yes seems to be the thing you want to change in it.

    Thanked by 1postcd
  • VitaVita Member

    Depending on the distro you can hash the new password and replace the root one in the shadow file. That's risky but can work. Google more about the structure of the shadow file and how to edit it.

    Thanked by 1postcd
  • teamaccteamacc Member

    Why not add a ssh key and just reset the password after logging in to the original system?

Sign In or Register to comment.