logoalt Hacker News

zahlmanlast Saturday at 6:16 AM2 repliesview on HN

I assume using `./*` rather than `.` in the `scp` command would have worked around the issue?


Replies

hrmtst93837yesterday at 9:07 PM

Using './*' would have avoided this in most shells because ordinary globbing excludes dotfiles, so .ssh and authorized_keys are not matched. In my experience scp is brittle for bulk syncs, so I run rsync -a --exclude='.ssh' --dry-run ./ user@host:~/target to verify before I commit the changes. I keep an out of band recovery path, like a temporary deploy key, a nonprivileged rescue user, or console access, as the only reliable way to avoid being locked out at 3AM.

show 1 reply
malickayesterday at 6:10 PM

Yes, since it would’ve copied the globbed files, rather than the current directory itself.