🖥️
Born2BeRoot
  • 📘Born2BeRoot
  • 🛠️Installing the virtual machine
    • 💿Virtual machine ISO
    • 🖥️VirtualBox
    • 💿Attaching ISO to VirtualBox
  • 🌀Installing Debian
    • 🌍Configure locals
    • 📶Configure the network
    • 🔐Set up users and passwords
    • 🕚Configure the clock
    • 💾non-BONUS: Partition disks
    • 💾BONUS: Partition Disks
      • 💾BONUS: primary partition
      • 💾BONUS: logical partition
      • 💾BONUS: encrypt logical partition
      • 💾BONUS: logical volume manager
      • 💾BONUS: logical volume group
      • 💾BONUS: logical volume root
      • 💾BONUS: logical volume swap
      • 💾BONUS: logical volume home
      • 💾BONUS: logical volume var
      • 💾BONUS: logical volume srv
      • 💾BONUS: logical volume tmp
      • 💾BONUS: logical volume var-log
      • 💾BONUS: file system of all logical volumes
    • 📦Configure the package manager
    • 🖥️Install the GRUB boot loader
    • 🎉Finish installation
  • ⚙️Virtual machine setup
    • ⚙️First connection
    • 👤Installing sudo & configuration of user and groups
      • 👤Creating a user
      • 👥Creating a group
      • 🫂Adding a user to a group
    • 📶Installing & configuring SSH
      • 📶Configuring SSH
      • 👬Connecting via SSH
    • 🔥Installing & configuring UFW 🔥🧱 Firewall
      • 🔥Allow a port to firewall
    • 🔐sudo policies
    • 🔑password policy 🔑
    • 🧾Script 🚨
    • ⏰Crontab
    • ✒️Signature.txt
  • 😊BONUS Services
    • 💡Lighttpd
    • 📰WordPress
    • 🐬Mariadb
      • 🐬Create database on Mariadb
    • 🐘PHP
    • 📰WordPress configuration
    • ⚡LiteSpeed
  • ✅Correction preparation
    • ✅Correction sheet
    • ❤️‍🩹Evaluation answer
    • ⌨️Evaluation commands
      • ✅Check no graphical interface
      • ✅Check UFW
      • ✅Check SSH service
      • ✅Check OS
      • ✅Check user and group
        • ✅Add user and check password policy
        • ✅Check group creation
        • ✅Check adding to group
      • ✅Check hostname
        • ✅Check change hostname
      • ✅Check all partitions
      • ✅Check sudo
        • ✅Check add user to sudo group
        • ✅Check sudo rules
        • ✅Check sudo logs
      • ✅Check UFW advanced
        • ✅Check UFW active rules
        • ✅Check rule creation
      • ✅Check SSH advanced
        • ✅Check SSH usage
      • ✅Check crontab of script
      • 🎉Finish !
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Virtual machine setup
  2. Installing & configuring SSH

Configuring SSH

PreviousInstalling & configuring SSHNextConnecting via SSH

Last updated 1 year ago

Was this helpful?

Going on, some files have been created and we need to configure them.

For that we will use or (we will need to install vim since it's not preinstalled using sudo apt install vim) or any other text editor.

  1. First file that we will edit will be /etc/ssh/sshd_config. If you are not on root you will not be able to edit the file; as you know, for switching to root we use su

su
nano /etc/ssh/sshd_config
  1. The # means that line it is commented; the lines that we will be edit have to be uncommented. Once we are editing the file we need to update the following lines:

#Port 22 -> Port 4242

#PermitRootLogin prohibit-password -> PermitRootLogin no

When finish we have to save the changes and leave the file.

  1. Now with the file /etc/ssh/ssh_config. (not sshd_config)

nano /etc/ssh/ssh_config

#Port 22 -> Port 4242

  1. Finally we must restart the ssh service so it can be updated. For that purpuse we will use:

sudo service ssh restart

and once it is done we will check the service state with:

sudo service ssh status

and confirm that everything is alright.

⚙️
📶
📶
Nano
VIM