...
Kein Format |
---|
$ ssh-keygen -t rsa -b 4096 -f $HOME/.ssh/id_rsa_hlrnnhr Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa_hlrnnhr): Enter passphrase (empty for no passphrase): ************************ Enter same passphrase again: ************************ Your identification has been saved in /home/user/.ssh/id_rsa_hlrnnhr. Your public key has been saved in /home/user/.ssh/id_rsa_hlrnnhr.pub. The key fingerprint is: b8:df:d1:14:48:03:00:68:5e:46:9c:1a:b2:b2:d4:f4 user@host The key's random art image is: +--[ RSA 4096]----+ | +oo....o | |. +.= . o | | =o=. . . | |o.o. E . . | |o. . S . | |. . o | | . . . | | . . . | | . . | +-----------------+ |
In this example, the private key is saved in the file /home/user/.ssh/id_rsa_hlrnnhr
, the corresponding public key in the file /home/user/.ssh/id_rsa_hlrnnhr.pub
. If you run this command, user
will be replaced by your local username.
...
Kein Format |
---|
ssh-keygen -yf $HOME/.ssh/id_rsa_hlrnnhr Enter passphrase: |
If you are not asked for a passphrase, please use ssh-keygen =pf $HOME/.ssh/id_rsa_hlrnnhr
to create a passphrase. Once you are certain that you have set a passphrase to protect the key, you can safely continue with uploading the public key as described below.
...
- Select: Type of key to generate: SSH-2 RSA
- Fill in: Number of bits in a generated key: 4096
- Press: Generate
- Fill in: your key passphrase
- Fill in: confirm your passphrase
- copy the shown public key to a new textfile for upload to HLRNNHR
(don't use "Save public key" for upload to HLRNNHR, wrong formatting here) - Press: Save private key
- Please remember the path name where you saved your SSH key files!
...
Kein Format |
---|
$ ssh -i $HOME/.ssh/id_rsa_hlrnnhr -l your_username blogin.hlrn.de Enter passphrase for key '/<home_directory>/.ssh/id_rsa_hlrnnhr': [...] |
Alternatively, use the SSH configuration file $HOME/.ssh/config
on your local machine to permanently store options for specific SSH connections so that they can be omitted on the command line.
...
Kein Format |
---|
Host blogin Hostname blogin.hlrn.de IdentityFile ~/.ssh/id_rsa_hlrnnhr User your_username |
Now the ssh
command will automatically choose the proper credentials in the future, i. e., -l your_username
and -i <private_key>
can be omitted from the command line so that ssh blogin
is sufficient.
...