Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I setup a user on my Ubuntu 12.10 server named "deploy" and I believe i added the user to the sudoers properly.

However, whenever I SSH into the server with this user, I get:

-bash: /etc/bash.bashrc: Permission denied

What would cause this permission error, and what is the proper way to debug this issue?

SUDOERS:

Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# User privilege specification
root    ALL=(ALL:ALL) ALL
deploy    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

PASSWD:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
syslog:x:101:103::/home/syslog:/bin/false
messagebus:x:102:104::/var/run/dbus:/bin/false
whoopsie:x:103:106::/nonexistent:/bin/false
landscape:x:104:109::/var/lib/landscape:/bin/false
sshd:x:105:65534::/var/run/sshd:/usr/sbin/nologin
deploy:x:1000:1001:,,,:/home/deploy:/bin/bash
share|improve this question
    
it would help to see what in /etc/password and /etc/sudoers for that user. –  Danila Ladner Sep 4 '13 at 14:26
    
Are you trying to use sudo in a script? Why would you need to have this user in sudoers to SSH into the server? –  TheFiddlerWins Sep 4 '13 at 14:28
    
This user will need sudo permissions, i disabled the root user and this user will be my user for doing all my deployments –  Joel Grannas Sep 4 '13 at 14:32
    
How did you disable "root" user and what's in sudoers? –  Danila Ladner Sep 4 '13 at 14:41
2  
yeah, fix that to 644. chmod a+r –  Danila Ladner Sep 4 '13 at 15:15
show 9 more comments

migrated from serverfault.com Sep 4 '13 at 15:25

This question came from our site for professional system and network administrators.

1 Answer

Permissions on bash.bashrc was not correct (600):

ls -l bash.bashrc
-rw------- 1 root root 2288 Jan 21 2013 bash.bashrc

Changing it to 644 fixed it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.