Skip to content

SSH Login ohne Passwort

Angeheftet Linux
  • Wird Zeit das man den Artikel hier mal vernünftig macht, habe deswegen gestern drei Stunden verplempert, weil vermutlich wg. der Hitze, der Groschen nicht fallen wollte 🙂

    Server

    Installation des Dienstes

    apt install openssh-server
    

    In der Datei /etc/ssh/sshd_config wird der SSH-Dienst gesteuert. Die Zeile, die uns interessiert.

    PermitRootLogin without-password
    

    Was bedeutet das jetzt?

    • without-password Der Passwort-Login für Root ist deaktiviert, dann kann man sich nur mittels SSH-Key einloggen, wenn dieser hinterlegt wurde.

    PermitRootLogin
    Specifies whether root can log in using ssh(1). The argument must be “yes”,
    “without-password”, “forced-commands-only”, or “no”. The default is “yes”.

    If this option is set to “without-password”, password authentication is disabled for
    root.

    If this option is set to “forced-commands-only”, root login with public key
    authentication will be allowed, but only if the command option has been specified
    (which may be useful for taking remote backups even if root login is normally not
    allowed). All other authentication methods are disabled for root.

    If this option is set to “no”, root is not allowed to log in.

    Quelle: http://manpages.ubuntu.com/manpages/trusty/en/man5/sshd_config.5.html

    Datei bearbeiten und dann den Dienst einmal neustarten

    service sshd restart
    

    oder

     /etc/init.d/ssh restart
    

    Client

    Wir erzeugen einen Key mit

    ssh-keygen -t rsa -b 4096
    

    Dann kopieren wir diesen Key auf das Zielsystem. Das geht aber nur, wenn

    PermitRootLogin yes
    

    steht. Also vorher auf dem Server umstellen und den Dienst neustarten!

    Key kopieren

    cat .ssh/id_rsa.pub | ssh username@domain.com 'cat >> .ssh/authorized_keys'
    

    Fertig!

    Danach auf dem Server wieder auf

    PermitRootLogin without-password
    

    umstellen. Ganz wichtig!!

  • Wenn das mal nicht geht, ist der Ordner .ssh auf dem Ziel/Quelle nicht vorhanden.

    Dann auf dem Ziel/Quelle

    ssh-keygen -t rsa
    

    ausführen, danach geht es.

  • Ich habe heute den Ursprungsbeitrag mal vernünftig aktualisiert, weil ich gestern drei Stunden bei dem Testen von sshfs verplempert habe. Zu sshfs kommt auch noch ein Beitrag 😉

  • Wie ihr ja wisst, benutze ich das Forum hier auch gerne als Notizbuch 🙂 Also mal wieder was hier notieren. Mein Windows Systemadmin sagte mir heute, das es auch folgendes gibt

    # ssh-keygen -t ed25519
    Generating public/private ed25519 key pair.
    Enter file in which to save the key (/root/.ssh/id_ed25519): /tmp/ed
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /tmp/ed
    Your public key has been saved in /tmp/ed.pub
    The key fingerprint is:
    SHA256:D33HCTW7Dy0p5kQdFTkPudx1PQh0EHFgkBvxy8KwhGM root@frank-ms7c92
    The key's randomart image is:
    +--[ED25519 256]--+
    |         o=O*o=+=|
    |      .  oo o+oB+|
    |     E o  o.o.o+*|
    |    . o +o...oo=o|
    |       .So.o= O .|
    |         o.= o + |
    |          . .   .|
    |                 |
    |                 |
    +----[SHA256]-----+
    

    Der Key liegt nur in /tmp kopieren lohnt also nicht 🙂

    Ob das jetzt die Zukunft ist, kann ich nicht beantworten. Ich wollte es aber hier mal festhalten, weil es wohl mittlerweile auch von vielen Projekten benutzt wird.

  • FrankMF FrankM hat am auf dieses Thema verwiesen

  • Proxmox 8.2 released

    Proxmox
    1
    0 Stimmen
    1 Beiträge
    87 Aufrufe
    Niemand hat geantwortet
  • Redis ändert das Lizenz Modell

    Redis
    2
    0 Stimmen
    2 Beiträge
    90 Aufrufe
    FrankMF

    Ein Artikel von Heise zum Thema

    Link Preview Image Datenbankanbieter Redis ändert sein Lizenzmodell – erneut

    Die No-SQL-Datenbank wird künftig nach einem dualen Modell lizenziert: Redis Source Available License Version 2 oder Server-Side Public License Version 1.​

    favicon

    Developer (www.heise.de)

  • ZFS - One Disk Pool -> Mirror Pool

    Linux
    1
    0 Stimmen
    1 Beiträge
    142 Aufrufe
    Niemand hat geantwortet
  • Debian 10 Buster 10.5 released

    Linux
    1
    0 Stimmen
    1 Beiträge
    196 Aufrufe
    Niemand hat geantwortet
  • ClusterSSH

    Angeheftet Linux
    4
    0 Stimmen
    4 Beiträge
    731 Aufrufe
    FrankMF

    Mal wieder lange dran rumgefummelt, bis es passte.

    I have figured out how to use any font in xterm. So for the case of the mentioned Inconsolata font size 14, the following works:

    Add these 2 lines into ~/.Xresources (create it if it does not exist)

    XTermfaceName: Inconsolata
    XTermfaceSize: 14

    Then, tell xterm to use this file:

    export XENVIRONMENT="${HOME}/.Xresources"

    Preferably add this export into .bashrc, so that it is persistent.

    comment out the font settings in ~/.clusterssh/config, if it exists: # terminal_font=6x13

    Quelle: https://unix.stackexchange.com/questions/230106/cluster-ssh-specify-terminal-font

  • 0 Stimmen
    1 Beiträge
    360 Aufrufe
    Niemand hat geantwortet
  • Nextcloud ohne https lokal nutzen!?

    Verschoben Nextcloud
    1
    0 Stimmen
    1 Beiträge
    734 Aufrufe
    Niemand hat geantwortet
  • mdadm

    Verschoben Linux
    5
    0 Stimmen
    5 Beiträge
    356 Aufrufe
    FrankMF

    Nachdem ich die SATA-Karte gewechselt habe, sind meine Probleme verschwunden. Mein NAS läuft seit Monaten einwandfrei.

    rock64@rp64v_2_1_NAS:~$ uptime 21:57:50 up 73 days, 4:44, 1 user, load average: 0,00, 0,00, 0,00

    https://forum.frank-mankel.org/topic/299/sata-karte-marvell-88se9230-chipsatz/16