S
S
Sergey Burduzha2021-10-13 21:02:39
SSH
Sergey Burduzha, 2021-10-13 21:02:39

How to create multiple ssh public keys?

Good evening.
I bought a server at work.
The computer has a private and public ssh key, which come by default. id_rsa
I created the .ssh folder and the .ssh/authorized_keys file on the server and copied the public key from the computer there.

Now I enter ssh [email protected]_address in the terminal and I get to the server without a password.

This is clear to me.

What should I do at home.

There are also ssh keys here, with which I connect to the github.

I need to somehow drag that public key from the server to my laptop, but the keys work in conjunction with private and public.

Help me to understand.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Karabanov, 2021-10-13
@serii81

I need to somehow drag that public key from the server to my laptop, but the keys work in conjunction with private and public.

Not necessary. The public key is placed on the machine to which you are going to connect.
It is convenient to copy public keys from a computer to a server using ssh-copy-id .
ssh-copy-id [email protected]_addressand the public key from the home computer will be copied to the server.
Always make a separate pair of keys for each machine (home computer, work computer, laptop, phone, tablet - each device should have separate keys).
The private key should never leave the machine on which it was generated, and should also be password protected (to avoid entering the password for the key every time, use ssh-agent).
PS
I recommend using ED25519 instead of RSA, a key pair can be generated like thisssh-keygen -t ed25519. Such keys do not at all get tired of RSA cryptographic strength, but encryption is faster and they are shorter (you will appreciate when you need to copy the public key by hand).

A
Arman, 2021-10-13
@Arik

also in .ssh/authorized_keys the public key of the home computer. Or do you want to connect to your home computer?

P
Pavel, 2021-10-14
@businassman

create another pair of keys. what's the problem then?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question