Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use `scp` to deploy a website's `.htaccess` file?

I am currently using the following command to upload my site content:

scp -r web/* [email protected]:site.com/

This works great except that the .htaccess file is not sent. Presumably, this is because it's hidden.

I have tried adding a second line to send the file explicitely:

scp -r web/.htaccess [email protected]:site.com/.htaccess

This works great except now I have to enter my password twice.

Any thoughts on how to make this deploy with only 1 or 0 entries of my password?

like image 952
Frank Krueger Avatar asked Dec 07 '22 09:12

Frank Krueger


1 Answers

Just combine the two commands:

scp -r web/* web/.htaccess [email protected]:site.com/

If you want 0 entries of your password you can set up public key authentication for ssh/scp.

like image 157
dF. Avatar answered Jan 05 '23 06:01

dF.