From ff0ba6c16f030c41e154fb3e560fadce929af458 Mon Sep 17 00:00:00 2001 From: JonLuca DeCaro Date: Sun, 25 Mar 2018 16:59:32 -0700 Subject: [PATCH] fixed shell op order for sudo --- lesson-6/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson-6/README.md b/lesson-6/README.md index 36fa6ea..5d62b9f 100644 --- a/lesson-6/README.md +++ b/lesson-6/README.md @@ -88,7 +88,7 @@ Then you'll want to set SSH up with mkdir ~/.ssh chmod 700 ~/.ssh cd ~/.ssh -sudo cp /root/.ssh/authorized_keys . ; sudo rm /root/.ssh/authorized_keys; sudo chown `whoami` authorized_keys; chmod 600 ~/.ssh/authorized_keys +sudo cp /root/.ssh/authorized_keys . && sudo rm /root/.ssh/authorized_keys && sudo chown `whoami` authorized_keys && sudo chmod 600 ~/.ssh/authorized_keys ``` Let's go over what this is doing - it creates the ssh directory, and sets the correct permissions. Then we enter it, copy the ssh key we originally set up for root and delete it for root, then take ownership of the file. Finally, we change the permissions of the actual authorized keys file.