linux - SU : Permission denied /bin/sh

07
2014-07
  • Questioner

    I added a new user in system:

    $ useradd new_user
    

    When I try to switch from root to new_user, I get this error:

    $ su new_user
    permission denied /bin/sh
    $grep new_user /etc/passwd
    new_user:x:2001:4001::/home/new_user:/bin/sh
    $/bin/ls -ld /bin
    dr-xr-xr-x    2 root     root          4096 Jan  1 00:07 /bin
    $/bin/ls -ld /bin/sh
    lrwxrwxrwx    1 root     root            20 Jan  1 00:07 /bin/sh -> /etc/alternatives/sh
    $/bin/ls -ld /etc/alternatives/sh
    lrwxrwxrwx    1 root     root             9 Jan  1 00:07 /etc/alternatives/sh -> /bin/bash
    $/bin/ls -ld /bin/bash
    -r-xr-x---    1 root     shell       700076 May 27  2014 /bin/bash
    
  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    linux - Login issue - .bashrc permission denied?
  • P K

    I logged in as root user and create a new user and set the password. But I am unable to switch to the newly created user.

    What is the permission problem of .bashrc file with root user?

    # adduser -m praveen
    # passwd praveen
    <password set>
    
    # su praveen
    bash: /home/monitor/praveen/.bashrc: Permission denied
    
    # ls -al /home/monitor/praveen
    -rw-r--r-- 1 praveen praveen  124 Jul 28 07:41 .bashrc
    

  • Related Answers
  • nhinkle

    /home/monitor was not in permission list of user praveen. Adding it fixed the problem.