For some reason an Ubuntu server (14.04.4 LTS) I'm working on will not allow "man" to be run by regular user. Example:
man ls
man: can't change directory to '/root': Permission denied
man: command exited with status 255: (cd /root && LESS=-ix8RmPm Manual page ls(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page ls(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=ls(1) pager -s)
How might this have happened and more importantly how can I fix it?
UPDATE:
Seems this only occurs after I su user
where "user" is a non privileged user. Workaround is to su -l user
but I still don't understand why man
would become a privileged command without the login flag.
You are currently in the folder
/root
.man
runs some command includingcd <current folder>
. In this case that iscd /root
(compare the 2nd line of the error). But that is not allowed for non-root user.The following will work:
To reproduce the same behaviour you can do this: