I would like to set the home directory for ftpuser to root. That's my command:

    # adduser ftproot -shell /bin/false -home /var/www

What is the directory term for root?

  • 1
    Very very bad idea. – A.B. Apr 9 '15 at 10:03
  • What are alternatives? – Tomblarom Apr 9 '15 at 10:07
  • root as in "the home directory of the superuser", or root as in "the Document Root of the web server"? – Mark Plotnick Apr 9 '15 at 14:02
  • Not the directory /var/www. It's / – Tomblarom Apr 9 '15 at 14:04

First of all it is indeed a bad idea to use the homedirectory of root for other purposes. Consider a dedicated home directory for the new user, root is always able to access it.

Are you indeed looking for setting the homedirectory of the ftp user to the homedirectory of the superuser root or are you looking for a way to safely specify a FTP root (jailed or similar) to isolate the ftp account?

Next, the arguments -shell and -home needs an additional - (--shell, --home). See also adduser --help

If you still want to do so, you must ensure that the new user gets access to the homedirectory of root.

Get the current homedirectory of root using getent passwd root. The homedirectory is specified in the 6th field (often /root).

Use --home /root in your command to specify the homedirectory.

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.