Skip to content

SSH Connections

Lean's edited this page Mar 22, 2024 · 43 revisions

Installing OPEN SSH

Install openssh

  • sudo pacman -S openssh
  • systemctl enable sshd

To start the sshd

  • systemctl start sshd
  • Better configure before starting

Configuring

Open the configurations file

  • sudo vim /etc/ssh/sshd_config
  • Remove the # on necessary configurations lines.
  • Simple Setup:
Port
AddressFamily
ListenAddress

image

Security using rsa keys

Increasing the security is very important so... Create the keypair for the CLIENT

  • ssh-keygen -t rsa -b 2048

This will create 2 keys the private and the public (.pub) in your profile .ssh/id_rsa In the SERVER create the .ssh folder in the profile that you want to login and create this new file

  • vim .ssh/authorized_keys

And paste everthing in .pub key to this file

ssh-rsa AAAAB3NzaC1...

Edit some configurations to disable other types of login

  • sudo vim /etc/ssh/sshd_config

Uncomment and Change

HostKey /etc/ssh/ssh_host_rsa_key
PermitRootLogin no
MaxAuthTries 2
HostbasedAuthentication no
IgnoreUserKnownHosts yes
IgnoreRhosts yes
PasswordAuthentication no
PermitEmptyPasswords no

Remote Desktop (Xorg)

  • sudo pacman -S xorg
  • touch ~/.Xauthority
  • chmod 600 ~/.Xauthority ``Uncoment and Change`
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

Clone this wiki locally