diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-10-06 18:29:16 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-10-06 18:29:16 +0300 |
commit | 79b8987774b87ca6300f2454b6b0405043014fe9 (patch) | |
tree | 19ac773bfd52d7fdf234269526c45c2ac6331b66 | |
parent | 79922e4e59e5ebe87117c65bf623fb414c2ef940 (diff) | |
download | eug-vs-xyz-79b8987774b87ca6300f2454b6b0405043014fe9.tar.gz |
blog: you should start using ssh-copy-id now!
-rw-r--r-- | blog/2021-10-06.md | 17 | ||||
-rw-r--r-- | blog/index.md | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/blog/2021-10-06.md b/blog/2021-10-06.md new file mode 100644 index 0000000..4611853 --- /dev/null +++ b/blog/2021-10-06.md @@ -0,0 +1,17 @@ +# You should start using `ssh-copy-id` now! +Over the last couple of weeks I had to simultaneously manage up to 4 virtual machines in the Cloud. Holy shit, I've lost so much time just trying to log into them - picking up the correct server IP, then finding the password for it, and then finally `ssh`-ing into it. That's such a painful process, especially when you have to repeat it over and over again. + +Luckily, there's a solution! Simply run `ssh-copy-id username@password` (the same way you would do with `ssh`, just replacing it by `ssh-copy-id`), enter your password and it will remember it. Of course you gotta have your keys set up, but I think everyone has. + +Well, as a bonus, to not mess with the IPs, you can also use `~/.ssh/config` like that: +```bash +Host <alias> + HostName <server ip> + User <username> +``` +You might guess what it's doing: running `ssh <alias>` will now expand to `ssh <username>@<server-ip>`! + +Of course you can add as much hosts as you want to your config. Combined with `ssh-copy-id`, you get a perfect solution for managing multiple web servers. + +## PS +If you are familiar with `tmux`, I highly recommend installing it right away on your server, and doing everything in a session. Even simple `tmux new` / `tmux a` will make your life even more easy! diff --git a/blog/index.md b/blog/index.md index 5f5a4ad..32208f1 100644 --- a/blog/index.md +++ b/blog/index.md @@ -2,6 +2,10 @@ ## 2021 +### October + +- [You should start using `ssh-copy-id` now!](2021-10-06.md) + ### September - [I'm back on Carnivore! :meat_on_bone:](2021-09-21.md) |