Friday, December 24, 2021

Switching between Kerberos & Unix Authentication mechanism

 I had installed kerberos by mistake on my local VM for skol linux and ever since it would allow to create  users but won't allow to change password. Actually I had no need of Kerberos and had selected the option by mistake while installing the VM. 

Now, even after removing all kerberos packages and rebooting, it still did not exit my system. So I wanted local unix authentication. 

Problems faced: allowing creation of new user, but not allowing to set password

The solution is to use pam-auth-update and the resulting menu will allow you to unselect kerberos and keep the unix authentication. 

unselect kerberos authentication, block password change unix users and suggest Gosa instead and you are good for setting password of local users using unix authentication

What to do if you forget your password and even root password?

 If you forget your password and even the root password, you can stare into a blank login screen not knowing what to do. Here is one break for that situation.

While you are at Grub , instead of clicking enter on your linux distribution or kernel, click E, this will take you to edit mode for starting of that kernel. Try to find one line with "quiet" in the end. At the end of this line append init=/bin/bash and press F10 to boot further into single mode. 

The single user mode directly takes you to the root user. type passwd root at the prompt to set the new password for root. 

If you get error like "Authentication token manipulation error" or if root@none:/ is shown at the prompt, then, type the following command

mount -o remount, rw/

this will remount the filesystem and will allow to change the root password. 

Thursday, December 23, 2021

wifi Tethering to VM on virtualbox

 The usual and most common method to pass internet to the VM from host network is to keep the adapter of VM in bridged mode and the internet connection of the host is shared to the VM whether VM is linux or windows

However, though this works without problem if the host internet connection is through wired medium(Ethernet). When host gets the connection through wifi, this method of bridge does not work. 

Soultion:

The solution is rather simple, in the guest VM settings in virtualbox manager, go to network and in Advanced settings, copy the mac address of the host wifi adapter(which you can get by going to network connections, and rt clicking the wifi adapter and then clicking status and noting down the MAC address) and paste it in the MAC address box replacing whatever was existing in the box.

This can be done only when the VM is offline. once done, check using ip address or ipconfig command in guest VM  and you would find that that the eth1 adapter in VM has already been allotted an ip address in same series as wifi adapter of host OS. ping google dns 8.8.8.8 and it should ping. open browser and check if it is opening google, if not, then just add DNS entry in VM which would be same  as gateway of WiFi dongle/router.

Wednesday, December 22, 2021

Getting internet via usb tethering(JIOfi) on Debian skol Linux VM created on virtual box & installing guest additions on it.

 The VM was created after downloading a iso file of Debian Blue ray iso and installing it to the VM.

Guest additions were required to run the VM in full screen, here is where problems started.

step1 : getting the usb tethered internet working

The Oracle virtual box does not support sharing of wifi connection (there is a trick, another blog post for that!) of host to guest, even if it supports, it is choppy at best, sometimes working, sometimes not working. 


I didn't have a wired connection of ethernet variety, so the only option left was to plug in USB of jiofi modem to laptop running windows 11 host. thereafter using the virtualbox (rt control key + home) menu, selected the USB modem (listed as Android) and made it visible to Debian VM. immediately, it got unistalled from windows and got connected to Debian. Drivers were added automatically.

The device was showing in command ip address( IPconfig is depreacted it seems) as usb0 and given an ip address. The jiofi uses 255.255.0.0 subnet mask. However, routing was messed up as the default routes all go to eth0, so this has to be disabled from the host first. (use vm manager, click on debian vm configuration and in Networks, select "Not Attached" in Adapter1).

The above step resolved all gateway issues etc and was able to ping the google dns 8.8.8.8. Browsing was still not going through, and therefore, had to add the jiofi DNS entry (which is same as gateway) manually in USB0 configuration.

Now, internet was working fine.

Step2: Install kernel headers

Follow this post

https://www.tecmint.com/install-kernel-headers-in-ubuntu-and-debian/

Step3: installing the guest additions

Follow this post 

https://linuxize.com/post/how-to-install-virtualbox-guest-additions-on-debian-10/


Skol Linux is very useful for school students with many apps for school subjects like physics, chemistry,maths,geography and also for topics like astronomy and music.