Wenn Du noch kein Keypair erstellt hast …
bach@hp:~$ cat .ssh cat: .ssh: Datei oder Verzeichnis nicht gefunden
kannst Du mittels „ssh-keygen“ ein Schlüsselprchen erstellen:
bach@hp:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/bach/.ssh/id_rsa): Created directory '/home/bach/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/bach/.ssh/id_rsa. Your public key has been saved in /home/bach/.ssh/id_rsa.pub. The key fingerprint is: SHA256:ORDHbfp/Vb+aoPVMVjPhlpUv1RLoIRbwQn0Or4 bach@hp The key's randomart image is: +---[RSA 2048]----+ | o+=o+ o.| | oo* + ...| | ..= o + oo++| | o. S * ooooo| | . .. + =.o. .| | . . . +o. | | . . .. o. | | E ..o.| +----[SHA256]-----+
Den Publich key anzeigen (und auf den Server kopieren) :
bach@hp:~$ cat .ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClndRM5ucVeDPsja41GMKPFepZDD3Ugz3Msx3FK4hdgoa8K6Egh0FiZ0GogCni95ZWYBCRU44YIReZPiTbtGXMdPPJ5qMIa8AEnvuthYgwev3ZYU9XJ0W0PCjtSrIxhn62ynUht5NQ3qvgLy/twDMoLEgYuyTLiNbyM8xXc1wcWkIfKLt3WjH3Dkp4BeEGiMcqld49fxEVmUhcufIY0N00aqOq27MEkzPfjWAbukFAhSVjrjWbWFO3RgNoW2eu9/7yavYs3SToq0S5VguywivZTbfWF7jKSTUQwEnkiuoIJYPRjHwxnhJY1voEkj3Q9li+1ubZggmoJ+CiGq+zQ9 bach@hp
Dann kannst Du Dich direkt mit key einloggen:
bach@hp:~$ ssh -l lug arche.uberspace.de The authenticity of host 'arche.uberspace.de (185.26.156.147)' can't be established. ED25519 key fingerprint is SHA256:Er1gFeWDUyR2SwmfYd/cB/K/h2ibMI+QtChVPnFYM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'arche.uberspace.de,185.26.156.147' (ED25519) to the list of known hosts. Enter passphrase for key '/home/bach/.ssh/id_rsa': Last failed login: Fri Mar 5 17:04:55 CET 2021 from 2a02:8109:43f:10a8:6cf1:3aa4:cde2:7da2 on ssh:notty There were 6 failed login attempts since the last successful login. Last login: Fri Mar 5 16:55:37 2021 from 31.150.9.137 Welcome to Uberspace 7! Current version: 7.9.0.0 Manual: https://manual.uberspace.de/en/ Watch out for changes at: https://manual.uberspace.de/en/changelog.html Follow us on Twitter for updates: https://twitter.com/ubernauten Is something unclear or does not work as expected? => check the server status: https://is.uberspace.online => reach out to our team: hallo@uberspace.de [lug@arche ~]$