How to create a new SSH user in LAMP stack?

  • Posted March 29, 2014

I created a fresh LAMP stack droplet. Now I have to provide my co-worker with access to server web directory (/var/www/) via SFTP. How could it be done right way?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You can simply add a new linux user for him and grant him access to write to /var/www. <br> <br><ul><li>Create a linux user for him: <a href=“”></a></li> <br><li>Grant him access to write to /var/www. You can do that by adding a new group called e.g. “developers”, adding both your users to it, setting all of the files in /var/www to be owned by the developers groups, and granting it write access:<pre>#create group: <br>groupadd developers <br>#add your users to it <br>usermod -a -G developers username1 <br>usermod -a -G developers username2 <br>#chgrp /var/www to devvelopers <br>chgrp -R developers /var/www <br>#grant its users write access <br>chown -R g+w /var/www</pre></li> <br></ul> <br> <br>Hope that helps!