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?
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
Re: Non-working keyboard on iMac with Debian in single-user mode
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:
Unshadow is a command from john package. Here it combines two previously copied files into one.
Then:
It will run faster if you use '-users:<username(s)>' option.
If password cracking succedes, run
to see results.
I've made an 'test' user with password 'test'.
More details: https://pentestforbeginners.blog/2018/0 ... swd-files/
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
Then:
Code: Select all
john unshadow.txt
If password cracking succedes, run
Code: Select all
john -show unshadow.txt
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
Re: Non-working keyboard on iMac with Debian in single-user mode
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.
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.
- kent_dorfman766
- Posts: 542
- Joined: 2022-12-16 06:34
- Location: socialist states of america
- Has thanked: 59 times
- Been thanked: 70 times
Re: Non-working keyboard on iMac with Debian in single-user mode
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.
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.
Re: Non-working keyboard on iMac with Debian in single-user mode
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:
Still, for the record:
- I don't get what @dashek means: That's what I did by using Kali Linux to access the hard disk, didn't I?
- Since when does a standard USB keyboard needs any specific driver? (This in 2023, not 2003)
Re: Non-working keyboard on iMac with Debian in single-user mode
You think about this line:
?
If so, you did exactly what I meant.
Re: Non-working keyboard on iMac with Debian in single-user mode
That's what I understood, yet I still got said error. I guess it will remain a mystery.If so, you did exactly what I meant.