user-documentation/modules/ROOT/partials/installation/post-install/convenient-user-login.adoc

42 lines
1.2 KiB
Text
Raw Permalink Normal View History

2024-02-10 12:18:43 +01:00
// Text excerpt about setting up a comfortable, key-based user login
// consumer postinstallation-tasks.adoc (main), hetzner-dc.adoc
//
An SSH key file saves the otherwise annoying and errorprone typing of the hopefully secure and sufficiently long password. Additionally, you may prepare your local desktop to use a short name instead of having to type in a complete FQN hostname.
2024-02-10 12:18:43 +01:00
a. On your desktop (Linux or macOS), create an SSH keyfile if not already available. It should not be secured by password to enable automatic processing.
2024-02-10 12:18:43 +01:00
+
[source,]
----
[…]# mkdir ~/.ssh
[…]# cd ~/.ssh
[…]# ssh-keygen -b 4096 -C "<YOUR_ACCOUNT>@example.com" -f id_<outputkeyfile>
2024-02-10 12:18:43 +01:00
----
b. Transfer the key file to your server.
+
[source,]
----
[…]$ ssh-copy-id -i $outputkeyfile.pub <YOUR_ACCOUNT>@host.example.com
----
c. Create a config file on your desktop with a convenient host name for your server.
+
[source,]
----
[…]$ vi ~/.ssh/config
Host <MYHOST>
Hostname host.example.com
User <YOUR_ACCOUNT>
ProxyCommand none
ForwardAgent no
ForwardX11 no
Port 22
KeepAlive yes
IdentityFile ~/.ssh/$outputkeyfile
----
d. Test the configuration
+
[source,]
----
[…]$ ssh <MYHOST>
----