4

I'm following this tutorial step by step,for

Here we clone the repo into a chmodded /var/www/[site_dir] folder. Note that we switch to the www-data user before running the git clone command. This is an important step because the deploy key we generated is owned by the www-data user and it will only work for that user, even if you are on the root.

I need to switch to www-data user, but when I try sudo su - www-data ( or sudo su www-data ) I faced with This account is currently not available.

I try ps aux and I see that the www-data user exists, Now I want to know how can I achieve that ? ( login with www-data user)

1 Answer 1

8

The www-data user is evidently configured with /sbin/nologin (or equivalent) as its shell, and thus the system will not allow you to login to that account. sudo lets you run a command as any user on the system, not just root. To clone the repo, you just need to sudo -u www-data git clone ... If you really need shell access as that user, sudo -u www-data bash will get you there.

Of course, this all depends on suitable settings in your sudoers file.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .