2

I installed kali and the next day after coming to work I forgot the username, I was able to find answers on how to change the password but not to get username info.

2 Answers2

1

If you can get terminal access:

cut -d: -f1 /etc/passwd

This command will print a list of all users.

If you need to reset the user password, run:

passwd username

as root, where 'username' is your username.

To get root access, the default login is:

username: root
password: toor

If in doubt, as you've only recently installed Kali, you could consider reinstalling it

  • I got a very long list of "users" starting with root, daemon, bin, sys....... – Ben Pettis Sep 13 '16 at 14:36
  • 1
    @BenPettis Do you recognise any? You could also try: cat /etc/passwd | grep /home, which should return a shorter list. If you post the whole list I might be able to guess which is yours – James Vickery Sep 13 '16 at 14:41
  • after you command it says, ntp:x:112:114:: /home/ntp:/bin/false What does that mean? – Ben Pettis Sep 13 '16 at 14:44
  • @BenPettis 'ntp' is one of the usernames - the command, in this case, is to view usernames – James Vickery Sep 13 '16 at 14:49
  • @BenPettis If you edit your question to include the whole cut -d: -f1 /etc/passwd output, I might be able to help you more – James Vickery Sep 13 '16 at 14:49
  • okay so Im going to type out the list – Ben Pettis Sep 13 '16 at 14:51
  • You can more simply list ls -lrt /home, which shows the home directories and the users who own them. The last (most recently updated) of these will most likely be for the user you created. – AFH Sep 13 '16 at 14:54
  • @AFH Good idea, I didn't think of that – James Vickery Sep 13 '16 at 14:56
  • @James - it saves ploughing through all the /etc/password entries. It assumes that the user has been created using normal home directory settings, which would almost certainly be the case for a user created during an installation. – AFH Sep 13 '16 at 14:59
  • @BenPettis If you're still typing, stop and do what AFH says instead - it should save a few hours ;) – James Vickery Sep 13 '16 at 15:01
  • root; daemon; bin;sys;sync;games;man;lp;mail;news; uucp;proxy;www-data; backup; list; irc; gnats; nobody; systemd-timesync; systemd-network, -resolve, -bus-proxy; _apt; mysql; epmd; debian-exim; uuidd; rwhod; iodine; miredo; ntp; stunne14; redsocks; rtkit; postgres; dnsmasq; messagebus; arpwatch; usbmux; debian-snmp; sslh; heoclue; couchdb; avahi; sshd; colord; saned; speech-dispatcher; pulse; king-phiser; debian-gdm; dradis; beef-xss – Ben Pettis Sep 13 '16 at 15:09
  • with ls lrt /home it says total 0 – Ben Pettis Sep 13 '16 at 15:09
  • @BenPettis Oh maybe the user doesn't have a home directory then. From the list above are they any that you recognise? – James Vickery Sep 13 '16 at 15:12
  • no I don't recognize any – Ben Pettis Sep 13 '16 at 15:23
  • @BenPettis Then are you sure you actually made a user account? If you're using Kali, it's fairly normal to just use the root account. If you want to make a user account, run adduser username – James Vickery Sep 13 '16 at 15:26
  • i really don't know, I have another computer I installed it on that im using now that during install it prompted for username and password – Ben Pettis Sep 13 '16 at 15:29
  • @BenPettis You could try installing Kali elsewhere (for example a VM) and having a look at the list of users there. That might give you a clue to which users aren't default – James Vickery Sep 13 '16 at 15:32
  • thanks I did that add user and I logged in, can you tell me where to check for other users now – Ben Pettis Sep 13 '16 at 15:34
  • nevermind I did ls /home and it showed me that my username is username. do you know how I can change it? – Ben Pettis Sep 13 '16 at 15:35
0

as root (or any user) in shell: getent passwd

Ipor Sircer
  • 4,103
  • 1
  • 16
  • 19
  • While this may answer the question, it would be a better answer if you could provide some explanation why it does so. – DavidPostill Sep 13 '16 at 17:21