8

I have recently installed Raspbian onto a Raspberry Pi. As part of the installation process I changed the user name and group from the default (pi) to my own (let's call it user) using usermod and groupmod. I as well moved the home directory /home/pi to the new user name /home/user using usermod. Everything works fine except that when I login using SSH instead of landing the new user directory /home/user I end up at the home directory /home.

Just as the directory /home/user exists with permissions 755. In addition to that the /etc/passwd file contains an entry that looks like the following:

user:x:1000:1000:User:/home/user:/bin/bash.

To me everything looks fine, but still when I login from SSH I get a prompt that looks like:

user@raspberrypi /home $.

Any idea why this may be happening or any simple solution? It's not a big deal but it is confusing me.

  • 2
    Take a look at your user entry in the /etc/passwd file. Make sure that the entry matches your expected home directory. – Steve Robillard Sep 8 '12 at 22:38
  • Can you tell us the output of the command echo $HOME. That's where the shell believes your user directory is. – Jivings Sep 9 '12 at 16:25
  • Is it only ssh or any login (if you have another way to log in). Have you restarted the device since the change? – XTL Sep 10 '12 at 5:51
2

Is the /home/user directory owned by user? If you created it as root or as pi then it probably won't be. Try sudo chown user /home/user to remedy this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.