I have server with multiple websites, and each website has their own user. Each time I want to do some modification to particular website I do su username
and go to the folder for that website.
the problem is each time I do su username
it show this error :
mkdir: cannot create directory `/root': Permission denied
this is very strange, why command su username
want to create a folder in /root
? is there a way to fix this?
Try:
I had the same problem and I took a look at the su manpage and noticed the login flags under options. Are you logged in as root when you do this work? If so, using su without loading the target user environment could result in this kind of error.
Source