LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2021, 10:55 AM   #1
daniel272
LQ Newbie
 
Registered: Feb 2021
Posts: 3

Rep: Reputation: Disabled
First login, sudo password not working, trying single user mode - keyboard not giving any input.


Hi,
If I'm asking question that's already solved then I'm sorry and redirect me please.
The problem is like in the title. I have just installed debian 4.19.171-2
[img]file:///C:/Users/chupito/Desktop/Temp/ver.JPG[/img]
Installed it on hyper-v. As with my previous installations I couldn't access root - the password I'd set up on install didn't work. But previously I was able to work it out by pressing "e" at the start and writing "init=/bin/bash" at the end of "linux" line:
[img]file:///C:/Users/chupito/Desktop/Temp/grub.JPG[/img]
Then by typing "mount -o remount,rw /" and "passwd".
My problem is that this time after getting command line in single user mode, after adding "init=/bin/bash" my keyboard doesn't give any input. It works on windows, obviously works in the grub while adding line, works in debian if I log in as standard user.
Can anyone help me out with this?
Thx.
 
Old 02-15-2021, 03:09 PM   #2
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: RHEL, Ubuntu
Posts: 212
Blog Entries: 1

Rep: Reputation: 82
To rule out the obvious, are you adding init=/bin/bash at the end of the line starting with linux /boot/vmlinuz... and before initrd?

Also, have you tried pressing every button on the keyboard in Windows to make sure it's getting the right input while you enter your password?
 
Old 02-15-2021, 05:45 PM   #3
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Just throwing something out.
Mouse and keyboard (input) is handled by Xorg. Not sure how it works with Gnome and the Wayland thing but X is still installed and there is an Xorg.log in my Gnome. So first thing that comes to mind for me is lack of adequate graphics support, to get decent graphics in VMWare you install the xorg vmware driver. I don't have a clue what's what in a Hyper-V scenario. Perhaps you need to find what graphics device Hyper-V uses.

Also, with Debian I typically create a root user account during setup, no sudo. Many/most new installations after reboot I get (command not found) as root, I can't run any executables till I create a /root/.bashrc file with the contents in the code box below, and reboot. If you're using sudo rather than a root account, this likely won't make a difference. But if you created a root user during setup, it might make a difference.
Code:
export PATH=/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
 
Old 02-15-2021, 09:13 PM   #4
daniel272
LQ Newbie
 
Registered: Feb 2021
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by redd9 View Post
To rule out the obvious, are you adding init=/bin/bash at the end of the line starting with linux /boot/vmlinuz... and before initrd?

Also, have you tried pressing every button on the keyboard in Windows to make sure it's getting the right input while you enter your password?
Yes, I add it exactly there. All the buttons works fine in win and in debian when I log into normal account.
 
Old 02-15-2021, 09:37 PM   #5
daniel272
LQ Newbie
 
Registered: Feb 2021
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Brains View Post
Just throwing something out.
Mouse and keyboard (input) is handled by Xorg. Not sure how it works with Gnome and the Wayland thing but X is still installed and there is an Xorg.log in my Gnome. So first thing that comes to mind for me is lack of adequate graphics support, to get decent graphics in VMWare you install the xorg vmware driver. I don't have a clue what's what in a Hyper-V scenario. Perhaps you need to find what graphics device Hyper-V uses.

Also, with Debian I typically create a root user account during setup, no sudo. Many/most new installations after reboot I get (command not found) as root, I can't run any executables till I create a /root/.bashrc file with the contents in the code box below, and reboot. If you're using sudo rather than a root account, this likely won't make a difference. But if you created a root user during setup, it might make a difference.
Code:
export PATH=/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
I did create root user. I also had to add "normal" account - it wouldn't let me install the system without it. Don't know why. The root user have a password which, when I write it when prompted is followed by "Authentication failure." I've had this issue previously and I was able to go around it with the method I described in the first post. Keyboard works fine in windows and in debian apart from the single user mode. I don't know if creating this file would help but I have no permission to root folder, and can't create any files there or in // directory. The first place I can do anything at all starts in /home/%user%.

I'll add that it's usb keyboard if that makes a difference but previously everything worked fine. Previously means couple of days ago.
 
Old 02-16-2021, 01:14 AM   #6
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by daniel272 View Post
I don't know if creating this file would help but I have no permission to root folder, and can't create any files there or in // directory. The first place I can do anything at all starts in /home/%user%.
It probably won't help with your immediate issues, however if you did create a root account there is a good chance you'll need to do this eventually. Whenever I need to create this file, I do it from a Live session since as you mention, if you don't have root access you can't do root stuff, boot up Ubuntu live or something.

I have also had the same scenario where the root password after installation would not work, and using the init=/bin/bash trick plus passwd would do the trick. However I would not do the remount that you are doing, that part is taken care of with the kernel arguments, below is from my notes, obviously the kernel was at version 4.15 last time I had this issue.
Quote:
linux /boot/vmlinuz-4.15.0-42-generic root=UUID=3c1154e9-a98c-44d9-99c6-0aa09c02a319 ro quiet splash $vt_handoff

linux /boot/vmlinuz-4.15.0-42-generic root=UUID=3c1154e9-a98c-44d9-99c6-0aa09c02a319 rw init=/bin/bash
 
Old 02-16-2021, 01:28 AM   #7
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Anyway, if you can't change the root password from single user mode because of the keyboard, you can boot a Linux live, chroot into Debian and make the change. So assuming from the live session your virtual / is /dev/sda1, the instructions below should do it:
Code:
mount /dev/sda1 /mnt
for i in /sys /dev /dev/pts /proc /run; do mount -B $i /mnt$i; done
chroot /mnt
passwd
Enter new password
Confirm new password
exit
for i in /run /proc /dev/pts /dev /sys; do umount /mnt$i; done
umount /mnt
EDIT: Or boot the Debian installer in rescue mode and select the root partition and ask it to give you a terminal in /, you will automatically be in a chroot and should not need to do it manually as above. When going into rescue mode with Debian installer, it will appear to be installing as it will ask you all the questions it asked during installation, just answer them and eventually it will ask you which partition to select as / to work with, after selecting the / partition you can then select to open a terminal in root.

Last edited by Brains; 02-16-2021 at 01:40 AM.
 
1 members found this post helpful.
Old 02-16-2021, 03:47 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
By default a regular user has very limited write permissions outside of their home directory. That's how linux works. To do so requires using su or sudo.

debian does not install sudo by default. su uses the root's password, sudo uses the regular users password. I don't use hyper-v but I never had a problem with Virtualbox or installing on a physical device. I've also never had problems with root password not working but I have the advantage of using US keyboard settings.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sudo apt update and sudo apt-get update giving error cryptonic472 Linux - Software 7 08-24-2019 08:16 AM
[SOLVED] sudo password different from non-sudo password edrom Linux - Newbie 2 04-20-2012 03:00 PM
how do I set different permission for single user for sudo login n direct login? bhaveshvv109 Linux - Security 2 11-08-2011 08:23 PM
Cannot login with any user except in single user mode scheidel21 Linux - Desktop 1 03-19-2008 01:42 PM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration