-1

I need to create the following file for www-data user like the following:

sudo /var/www/.ssh/authorized_keys

But non of www, .ssh directories and authorized_keys file does not exists. How could I create them all and set owner www-data for all of them by using one (or maybe two) commands?

Erik
  • 203
  • 2
  • 5
  • 13

1 Answers1

1

sudo mkdir -p /var/www/.ssh/

sudo chown -R 'www-data':'www-data' /var/www

That will get you most of the way (assuming the user and group are correct). I don't think this site will treat your question well for asking something as basic as how to create a directory.

Andy
  • 1,101
  • 1
  • 7
  • 10