Monday, July 9, 2007

Adding users and Shadow Password

So the Nokia 770 does have the "adduser" script. I tried:
adduser clayg

Everything looked like a normal debian adduser script, full name, room number etc. But it didn't work quite right.

When I tried to log-in with my new user from putty it booted me right back out. So I tried switching users from the console.
su clayg

It told me stright away /bin/bash doesn't exist. Hince the whole "busybox" thing every time I log-in. I'm not running the bourne-again shell!

I headed to /etc/passwd to investigate and guess what - the password file on the Nokia 770 is NOT SHADOWED.

To create the /etc/shadow file and remove the encrypted passwords from the world readable file /etc/passwd issue the command:

This command will create the file /etc/shadow (which is only readable by root) and use that to store all the user's encrypted passwords.

Now, if you look at the last line in /etc/passwd you should see something like this:
clayg:x:1000:1000:Clay Gerrard,,,:/home/clayg:/bin/bash

It's the last bit that's causing problems. The last field is the shell to invoke when the user logs in, and if you check under /bin - bash really isn't there...

I referenced the entries for root and user as an example, and changed the last field from /bin/bash to /bin/sh

I guess I could have just installed bash...

No comments: