Install Debian 12 (bookworm)

Download... https://www.debian.org/ .. debian-12.x.0-amd64-netinst.iso

Run Debian image and choose (setup in text mode)
 Debian 12

then choose Language, use <Tab>  and <Space> and then <Enter> to confirm your selection

next select your country, for Europe  choose <other> then <Europe> and then your country
after this select default locale and configure the keyboard

 Debian 12

Check and add your network settings and give the hostname for your server <server1>
then add your domain name <example.com>

Debian 12

now create root password <password>
and new user and password


Now you need to format the disk, so use the default option and then select the disk and partition scheme as <All files in one partition>, confirm and press <Finish partitioning and write changes to disk>
after this basic system will be installed

 Debian 12


By configure the package manager press <No> then select mirror country to download Debian software packages. Then follow the on-screen questions.


Now select the software you want to install. First disable <Debian desktop environment> and <... GNOME>, then select the web server, SSH server, and default system utilities.

Debian 12

Then install the GRUB bootloader and select your disk partition as </dev/sda>
and reboot your server.

 Debian 12

After rebbot you can log in to your new system and install more software you need.

First install the OpenSSH server and net-tools

$ apt install ssh openssh-server

and

$ apt install net-tools


This package includes the important tools for the network. This includes programs as: arp, hostname, ifconfig, netstat, rarp, route.


SSH Root Login Configuration:

Enable SSH Root Login on Debian Linux Servers
If you try to connect to your server via SSH as root user without the proper configuration, you will receive a "Permission denied" error.

On Debian systems, the root password was configured during installation. If for some reason you need to update the root password, you can set or change it using the <passwd> command.

 
You will be prompted to enter your current root password, followed by the new root password you want to set.
This command updates the root password with a new password.

 

Edit SSH Configuration
Editing the SSH configuration file to allow root login. Open the sshd_config file with a text editor like pico.

$ pico /etc/ssh/sshd_config


Now you can change and enable the SSH port
Find line #Port 22 and then enable it

Port 22


Then in the configuration file, find the line that says #PermitRootLogin prohihit-password, add a new line below this line

PermitRootLogin yes

This line will allow the root user to log in via SSH.


If you try to connect and you get the following error:
Unable to negotiate with <your IP> port 22: no matching key exchange method found. Their offer: <... list of options.... diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,...> [preauth]


Reopen the SSH configuration file 

$ pico /etc/ssh/sshd_config

And add these lines between the <# Logging> and <# Authentication> sections (change KexAlgorithms depending on your offer list in error message).
 

## NEW <your name> - <date>
HostkeyAlgorithms +ssh-rsa,ssh-dss
KexAlgorithms +diffie-hellman-group1-sha1

 


Then save file and restart sshd.service

$ systemctl restart sshd.service

If any error check with command

$ journalctl -xeu ssh.service

 


install logrotate

apt install -y logrotate

 


You can also install midnight commander 

$ apt install mc


 then start with

$ mc