<p>I am currently using the following command to upload my site content:</p>

<pre><code>scp -r web/* user@site.com:site.com/
</code></pre>

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

<p>I have tried adding a second line to send the file explicitely:</p>

<pre><code>scp -r web/.htaccess user@site.com:site.com/.htaccess
</code></pre>

<p>This works great except now I have to enter my password twice.</p>

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

[{'answer_id': 33791, 'author': 'dF.', 'author_id': 3002, 'author_profile': 'https://Stackoverflow.com/users/3002', 'pm_score': 4, 'selected': True, 'text': '<p>Just combine the two commands:</p>\n\n<pre><code>scp -r web/* web/.htaccess user@site.com:site.com/\n</code></pre>\n\n<p>If you want 0 entries of your password you can set up <a href="http://sial.org/howto/openssh/publickey-auth/" rel="noreferrer">public key authentication</a> for ssh/scp.</p>\n'}, {'answer_id': 33803, 'author': 'Kyle Cronin', 'author_id': 658, 'author_profile': 'https://Stackoverflow.com/users/658', 'pm_score': 2, 'selected': False, 'text': "<p>A word of caution - don't attempt to match dotted files (like <code>.htaccess</code>) with <code>.*</code> - this inconveniently also matches <code>..</code>, and would result in copying all the files on the path to the root directory. I did this once (with <code>rm</code>, no less!) and I had to rebuild the server because I'd messed with <code>/var</code>.</p>\n\n<p>@jwmittag:</p>\n\n<p>I just did a test on Ubuntu and <code>.*</code> matches when I use <code>cp</code>. Here's an example:</p>\n\n<pre><code>root@krash:/# mkdir a\nroot@krash:/# mkdir b\nroot@krash:/# mkdir a/c\nroot@krash:/# touch a/d\nroot@krash:/# touch a/c/e\nroot@krash:/# cp -r a/c/.* b\ncp: will not create hard link `b/c' to directory `b/.'\nroot@krash:/# ls b\nd  e\n</code></pre>\n\n<p>If <code>.*</code> did not match <code>..</code>, then <code>d</code> shouldn't be in <code>b</code>.</p>\n"}, {'answer_id': 33804, 'author': 'Jörg W Mittag', 'author_id': 2988, 'author_profile': 'https://Stackoverflow.com/users/2988', 'pm_score': 2, 'selected': False, 'text': '<p>Some background info: the <code>*</code> wildcard does not match so-called "dot-files" (i.e. files whose name begins with a dot).</p>\n\n<p>Some shells allow you to set an option, so that it <em>will</em> match dot-files, however, doing that is asking for a lot of pain: now <code>*</code> will also match <code>.</code> (the current directory) and <code>..</code> (the parent directory), which is usually not what is intended and can be quite surprising! (<code>rm -rf *</code> deleting the parent directory is probably not the best way to start a day ...)</p>\n'}]
['https://Stackoverflow.com/questions/33790', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/338/']