From d6a31731d767d31f1c0e0e1dd3da95a2bff4db78 Mon Sep 17 00:00:00 2001 From: bonnie Date: Sun, 19 Jul 2020 23:06:03 +0800 Subject: [PATCH] System - Set the default user and key for a host when using SSH --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb38aeb..e201d03 100644 --- a/README.md +++ b/README.md @@ -1378,6 +1378,15 @@ ssh -A @ ssh @ ``` +##### Set the default user and key for a host when using SSH +```bash +# add the following to ~/.ssh/config +Host myserver + User myuser + IdentityFile ~/path/to/mykey.pem + +# Next, you could run "ssh myserver" instead of "ssh -i ~/path/to/mykey.pem myuser@myserver" +``` ##### Follow the most recent logs from service ```bash @@ -1565,7 +1574,7 @@ passwd username ##### Edit environment setting (e.g. alias) ```bash -1. joe ~/.bash_profile +1. vi ~/.bash_profile 2. alias pd="pwd" //no more need to type that 'w'! 3. source ~/.bash_profile ```