📂
my database
  • Introduction
  • Home setup
    • Raspberry
      • OS Installation
      • Enable SSH and first access
      • SSH configuration
      • Change default credentials
      • Home DNS
      • WiFi USB
      • Live cam
      • ESP32
      • AD/DA
      • Humidity sensors
    • Remote access
      • ssh
      • Turn on/off remote computer
      • Dynamic DNS
      • Remote ssh
      • Home VPN
  • GNU/Linux commands
    • locale
    • crontab
    • chmod
    • router
  • Future sections
    • Topics
  • Research
    • Introduction to Sustainability
Powered by GitBook
On this page

Was this helpful?

  1. Home setup
  2. Remote access

ssh

PreviousRemote accessNextTurn on/off remote computer

Last updated 4 years ago

Was this helpful?

SSH change port

Add to sshd configuration

Go to the file

# nano /etc/ssh/sshd_config

and add line

Port <SSH_NEW_PORT>

Configure SELinux

# semanage port -a -t ssh_port_t -p tcp 50

Configure Firewall

# firewall-cmd --permanent --remove-service=ssh
success
# firewall-cmd --permanent --add-port=<SSH_NEW_PORT>/tcp
success
# firewall-cmd --reload

Restart sshd service

# systemctl restart sshd 
# systemctl status sshd.service

Remote access be like

# ssh -p <SSH_NEW_PORT> server@ip

SSH using keys

On your remote device follow these steps.

Generate key

$ ssh-keygen -t ed25519

By default, will be stored at /home/user/.ssh/id_ed25519

Add it to remote key (server)

$ ssh-copy-id -p <PORT> -i ~/.ssh/id_ed25519 user@remote

This will add the public key (i.e. id_ed25519.pub) to the the server file ~./.ssh/authorized_keys

Add passphrase to KeePassXC

Now, passphrase won’t be asked when KeePassXC is unlocked.

Disable ssh with password

PasswordAuthentication no

Next, restart ssh service

RHEL:

$ sudo service ssh restart

Arch:

a

: TL;DR, use RSA 4096 or ed25519.

Generate a passphrase with and use it as passphrase when it asks you for one.

Follow this so you can add the passphrase for the generated key automatically to the ssh-agent whenever KeePassXC db is unlocked.

Open file /etc/ssh/sshd_config and set

How to change SSH port on Centos 6, 7, and 8. Changing SSH Port will help to secure your Linux VPS server, here is ultimate guide how to secure linux vps server …monovm.com
Comparison
KeePassXC
tutorial,
https://linuxhandbook.com/ssh-disable-password-authentication/