0

I recently created a new user on a Linux machine (Red hat). I was able to su - that user and it worked fine at that time. I shared the credentials with user. User reported that he is not able to login. So I tried to login to his account using PuTTY and I got permission denied error. I am able to su - user through root user.

  • 1
    Ether the user is denied through system settings (sshd config, userdb - it will help if you tell us how you created the user) or more likely he's entering the wrong password - did you try to login with the user credentials? – nkms Oct 12 '15 at 9:02
1

Check the ownership of the user's home dir :

$ ls -ld /home/username

If a different user owns the file:

sudo chown root:root /

sudo chmod 755 /

sudo chown root:root /home

sudo chmod 755 /home

sudo chown -R username:username /home/username

sudo chmod 755 -R /home/username
  • You usually get a successful login with cwd as / is this case and a message of sort like "Could not chdir to home directory..." – nkms Oct 12 '15 at 9:04
  • it's only about ownershipt and permissions , look at my folders infos : younes@emachines:~$ ls -ld / drwxr-xr-x 25 root root 4096 Oct 12 14:33 / younes@emachines:~$ ls -ld /home drwxr-xr-x 3 root root 4096 Oct 5 23:40 /home younes@emachines:~$ ls -ld /home/younes drwxr-xr-x 10 younes younes 4096 Oct 12 14:53 /home/younes younes@emachines:~$ now try theses cmds : sudo chown root:root / sudo chmod 755 / sudo chown root:root /home sudo chmod 755 /home sudo chown -R username:username /home/username sudo chmod 755 /home/username – Jonah Oct 12 '15 at 14:24
  • the comment doesn't show comands well , i edited the answer :) – Jonah Oct 12 '15 at 14:30

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.