M
M
mnemonik12017-07-05 09:01:03
SSH
mnemonik1, 2017-07-05 09:01:03

How to switch between users via ssh if the keys were generated in PUTTY?

In general, the problem is this, I generated keys via PUTTY, then I created a droplet on DigitalOcean, specifying an ssh key, I created a droplet, I go to it via PUTTY: I drive in ip, I specify the path to the key in SSH-Auth, I go to the server, first of all I create a new one user, I give him rights, then I throw in
/.ssh/authorized_keys
on a new user so that he can ssh into him and then there was a problem, when the command
ssh [email protected]
gives an error Permission denied (publickey).
I decided to find out how it is, there are authorized_keys, where does he get the key from then? The team
ssh [email protected] -vfound the following

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

I only have authorized_keys and know_hosts in my /.ssh folder, nothing else, maybe I'm stupid and the answer is on the surface, help me figure it out

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2017-07-05
@mnemonik1

When you connect to the server via putty, the private key is where the putty is.
And when you have already logged into a remote server, and user1 is trying to connect to user2, then the private keys should be in user1.
You can already generate a new key inside user1, and put the public key from it into user2.
Or convert the private key from putty to ssh format and put it in user1

O
ololo pishpish, 2017-07-05
@ololopishpishrealne

Are you sure you are adding a key to that user (home/username/.ssh/authorized_keys)?
Well, in order to work from different users, it is not necessary for everyone to generate a key and connect. You can switch in the current session with:
:~$su username

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question