Quantcast
Channel: Recent Gists from 84adam
Viewing all articles
Browse latest Browse all 34

ssh_vim_bash_SETUP

$
0
0
ssh_vim_bash_SETUP.md

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. Check groups for new user: # groups <new-username>
  4. Edit sshd_config settings: # vim /etc/ssh/sshd_config
  5. Under "Authentication", change PermitRootLogin from yes to no: "PermitRootLogin no"
  6. (Optional) Change "MaxAuthTries" to a lower value to limit login attempts for any user: "MaxAuthTries 4"
  7. Save the changes: :wq (save and exit vim)
  8. Restart the ssh daemon: # systemctl restart sshd
  9. Check the status of sshd: # systemctl status sshd (it should say "active (running)")
  10. Verify the new configuration: try logging in as the new user and then becoming root: $ sudo su -
  11. If the above works, try logging in as root again over SSH. Even with the correct password you should get 'access denied'
  12. 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

Viewing all articles
Browse latest Browse all 34

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>