Celeb Glow
updates | March 21, 2026

Why the file has 0755, but 'Permission denied'?

Why the file has 0755, but I got an error 'Permission denied'?

root@vagrant-ubuntu-trusty-64:~/.rbenv/versions/2.2.0/bin# ls -la
total 14000
drwxr-xr-x 2 root root 4096 Feb 9 20:25 .
drwxr-xr-x 6 root root 4096 Feb 9 20:25 ..
-rwxr-xr-x 1 root root 4861 Feb 9 20:25 erb
-rwxr-xr-x 1 root root 565 Feb 9 20:25 gem
-rwxr-xr-x 1 root root 209 Feb 9 20:25 irb
-rwxr-xr-x 1 root root 1263 Feb 9 20:25 rake
-rwxr-xr-x 1 root root 957 Feb 9 20:25 rdoc
-rwxr-xr-x 1 root root 207 Feb 9 20:25 ri
-rwxr-xr-x 1 root root 14295306 Feb 9 20:23 ruby
vagrant@vagrant-ubuntu-trusty-64:~$ /root/.rbenv/versions/2.2.0/bin/erb
-bash: /root/.rbenv/versions/2.2.0/bin/erb: Permission denied
1

1 Answer

the "vagrant" user will not have permissions to do anything in /root because it will have 0700 perms. Therefore anything in /root or in any subdirectory under /root etc will not be accessible by any use other than root. Prefix it with sudo and it should work.

This is the correct setup and I strongly recommend that you leave /root's perms as 0700. Don't chmod 0755 to make that command work or anything.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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