Skip to content

Comment on Locking down a fresh Linux server: What you actually need to do before bots find it

You are viewing one comment and its replies. View all comments

Comments

  • @CallMeAl@piefed.world· · edited

    sudo apt update && sudo apt upgrade -y
    should be
    sudo apt update && sudo apt full-upgrade -y

    also for

    echo “PASTE_YOUR_PUBLIC_KEY_HERE” | ssh your_username@your_server_ip “mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys”

    why not just use ssh-copy-id ?

    edit: added more thoughts

    28
    • You’re completely right on both counts, full-upgrade handles dependency shifts properly without leaving packages held back, and ssh-copy-id is much cleaner. Updated the guide to reflect both.

      13
    • I love ssh-copy-id, but end up doing it manually about half the time anyway. I’ve tried integrating it into build scripts and find what the op did more reliable.

      Could just be me though… it is Linux, and there a dozen ways to skin Linus. We all have our assholes and opinions.

      2
      • I’ve tried integrating it into build scripts In a script I would also write out all the commands I want to run. After all, ssh-copy-id is a shell script itself. For instructions for someone to run interactively, I think ssh-copy-id makes the most sense.

        2

Sign in to comment. Sign in