Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Non-working keyboard on iMac with Debian in single-user mode

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
Cubytus
Posts: 4
Joined: 2023-01-17 23:46

Non-working keyboard on iMac with Debian in single-user mode

#1 Post by Cubytus »

Hi to all,

I have been asked to restore an old iMac that had Debian installed a few years ago. It uses a standard PC USB keyboard, not the Mac version. Works fine in the GUI.

The previous admin left a bunch of administrative passwords from all software and computers we are using, but sadly, this supposedly unused iMac doesn't accept the defined password. There was a post-it on the computer with what looked like a password, but this one isn't correct either. Of course I tried the usual ones "12345678", "1234" and "qwerty", as well as the username. No luck.

Si I tried the good old method of adding the "init=/bin/bash" parameter to the boot options, which in fact sent me to a single-user command, but as soon as I hit the single user prompt, the keyboard stops responding, no letter or number can be entered.

I'm not familiar with whatever quirks Debian has when installed on Macs.

Any idea how I could reset the root (and sudo) password on this old Debian?

User avatar
dashek
Posts: 47
Joined: 2022-12-03 20:59
Has thanked: 7 times
Been thanked: 5 times

Re: Non-working keyboard on iMac with Debian in single-user mode

#2 Post by dashek »

If existing install uses shadow, you could try to crack root/ user in sudoers password wit John The Ripper.
Get external access to hard drive - boot from usb live stick etc.
Mount apropriate partition and copy /etc/passwd & /etc/shadow to chosen working directory. You will need root to do it, because /etc/shadow is root-only readable. Change copied files' perms, as you will probably want to work as a normal user from now.
Now, you will need to install package john.
In your working directory, run:

Code: Select all

unshadow shadow passwd > unshadow.tx
Unshadow is a command from john package. Here it combines two previously copied files into one.
Then:

Code: Select all

john unshadow.txt
It will run faster if you use '-users:<username(s)>' option.
If password cracking succedes, run

Code: Select all

john -show unshadow.txt
to see results.

I've made an 'test' user with password 'test'.

Code: Select all

normal@EN4P5:~/cracking$ sudo cp /etc/passwd ./
normal@EN4P5:~/cracking$ sudo cp /etc/shadow ./
normal@EN4P5:~/cracking$ unshadow passwd shadow > unshadow.txt
normal@EN4P5:~/cracking$ l
passwd  shadow  unshadow.txt
normal@EN4P5:~/cracking$ john -users:test unshadow.txt 
Loaded 1 password hash (crypt, generic crypt(3) [?/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
test             (test)
1g 0:00:00:00 100% 1/3 2.857g/s 274.2p/s 274.2c/s 274.2C/s test..Test0
Use the "--show" option to display all of the cracked passwords reliably
Session completed
normal@EN4P5:~/cracking$ john -show unshadow.txt 
test:test:1001:1001:test,,,:/home/test:/bin/bash

1 password hash cracked, 1 left
More details: https://pentestforbeginners.blog/2018/0 ... swd-files/

Cubytus
Posts: 4
Joined: 2023-01-17 23:46

Re: Non-working keyboard on iMac with Debian in single-user mode

#3 Post by Cubytus »

Hm, I must be doing something wrong because I get the message "0 password loaded" or something of the sort. Insights?

Details: I downloaded the latest "everything" variant of Kali Linux since this computer isn't connected to the internet (WLAN access requires a certificate locked in the other Debian install), so I assume it contains everything needed.

User avatar
kent_dorfman766
Posts: 529
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 56 times
Been thanked: 69 times

Re: Non-working keyboard on iMac with Debian in single-user mode

#4 Post by kent_dorfman766 »

As @dashek mentioned, your choices are:
1) externally access the hard disk to blitz the password entry, and/or
2) come up with a supported keyboard. My spidey sense tells me that the PC/USB keyboard needs a driver that isn't installed at single user level.

Cubytus
Posts: 4
Joined: 2023-01-17 23:46

Re: Non-working keyboard on iMac with Debian in single-user mode

#5 Post by Cubytus »

Alas, I couldn't complete the job on this computer. One person on the team decided to hoard all powers and bully the others to resignation.

Still, for the record:
  1. I don't get what @dashek means: That's what I did by using Kali Linux to access the hard disk, didn't I?
  2. Since when does a standard USB keyboard needs any specific driver? (This in 2023, not 2003)

User avatar
dashek
Posts: 47
Joined: 2022-12-03 20:59
Has thanked: 7 times
Been thanked: 5 times

Re: Non-working keyboard on iMac with Debian in single-user mode

#6 Post by dashek »

Cubytus wrote: 2023-07-02 20:43 I don't get what @dashek means: That's what I did by using Kali Linux to access the hard disk, didn't I?
You think about this line:
dashek wrote: 2023-01-18 12:06 Get external access to hard drive - boot from usb live stick etc.
?
If so, you did exactly what I meant.

Cubytus
Posts: 4
Joined: 2023-01-17 23:46

Re: Non-working keyboard on iMac with Debian in single-user mode

#7 Post by Cubytus »

If so, you did exactly what I meant.
That's what I understood, yet I still got said error. I guess it will remain a mystery.

Post Reply