Skip to content

Instantly share code, notes, and snippets.

@84adam
Last active October 11, 2024 16:29
Show Gist options
  • Save 84adam/c415125eb3392f65d88286ec1c3f50fa to your computer and use it in GitHub Desktop.
Save 84adam/c415125eb3392f65d88286ec1c3f50fa to your computer and use it in GitHub Desktop.
ssh_vim_bash_SETUP

no root ssh

  1. Create a new non-root user, follow the prompts: # adduser <new-username>
  2. Give sudo permissions to the new user: # usermod -aG sudo <new-username>
  3. Ensure that sudo is installed (which sudo ; if none, install it: apt install sudo)
  4. Check groups for new user: # groups <new-username>
  5. Edit sshd_config settings: # vim /etc/ssh/sshd_config
  6. Under "Authentication", change PermitRootLogin from yes to no: "PermitRootLogin no"
  7. (Optional) Change "MaxAuthTries" to a lower value to limit login attempts for any user: "MaxAuthTries 4"
  8. Save the changes: :wq (save and exit vim)
  9. Restart the ssh daemon: # systemctl restart sshd
  10. Check the status of sshd: # systemctl status sshd (it should say "active (running)")
  11. Verify the new configuration: try logging in as the new user and then becoming root: $ sudo su -
  12. If the above works, try logging in as root again over SSH. Even with the correct password you should get 'access denied'
  13. DONE!

vim configuration

$ vim .vimrc

set wrap
set number
set colorcolumn=80
set tabstop=4

bash configuration

$ vim .bashrc

# uncomment for a colored prompt, if the terminal has the capability
force_color_prompt=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment