klucze prywatne WinSCP a sftp

0

Mam parę kluczy dla WinSCP i bez problemu się łącze z pewnym serwerem autoryzując się kluczem prywatnym oraz ręcznie wysyłam/pobieram pliki.
Teraz potrzebuje zrobić to samo dla sftp pod linuksem, wszystko się upiera w format klucza jak podejrzewam.
Pytanie jest następujące: - jak zaadoptować klucz prywatny z WinSCP do sftp?

0

Samo skopiowanie do ~/.ssh/?

Przed momentem sobie wygenerowałem klucza przykładowego i tak wygląda:

cat ~/.ssh/id_rsa
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEA6zIDLrRUhTFEgpSiz0PISFhvYUTbkRY+FjVuDR1yaNtBFYH3VJf9
NOBaT/iS0+PDx4g7YaKulS/dMf6F6CmQY1naDmtSutr5WMM/yG+7wJiEtOnoqmKF7pi8LK
PGpmlbTuKHvakEJxd1Kw0JnODWZpNa8AlkpJ1/nGR7AXIH6Zn+kem4+S00YBFApMLCfGnF
cJ9bx5T/7B+gXf2Gfko01zSrV5LM3wNgfW1nLxvb4wwpfTB5qDMNjo5nOZrabMpcSs2czj
ralyZ9xBj3FLvKtv18dm4+K/v53WnvB42OzWLCXJX4vMSrmEtmN1PDwuesdFSJSsEK6k/U
53l/aBHvXHDm2vuTOjikBg12EYied8guAGQLbnvm5ZKDjdCpXNgeNqFUxai1oI8W0u3qM/
oQ/Q5Hevsv7pC3hahpiSppaXmGieAN6/eTwQd/VzsebPBJuA2QWx7QuD1leDX0fWV1exqC
csICI9VM62Jac6/wB1EPDzA7ePJyqC9hWhm9u1R9AAAFgH/Tz85/08/OAAAAB3NzaC1yc2
EAAAGBAOsyAy60VIUxRIKUos9DyEhYb2FE25EWPhY1bg0dcmjbQRWB91SX/TTgWk/4ktPj
w8eIO2GirpUv3TH+hegpkGNZ2g5rUrra+VjDP8hvu8CYhLTp6Kpihe6YvCyjxqZpW07ih7
2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Ft+7Jz09vaLmDSnmzf7BYm/uJ6mDZmpdr04YdEHIuUAvqbDBl9
hrXZ2SsUKx+Z79lHPYHv1sPPOSAr/OvePU456k6sELufLIA7IAAADBAPsMXjQNr1RuLJhZ
7LCzJM9yVavTK8b/qCfFGZBdG/+pK91UEPB/0M8e+i7rmm8c4A/hUQ1HeO43vJXRpMq5T5
MJaENDqBnjqW78YTVCfmpl2V1f/M57N1RSKfZpv3WVLRl1AcLe9JqWk3o2VgA2mQYqEx7R
DXziCRj/EvoKtO4URvT2wVSGbDm9oS/4DOPCQlCTP6bLh9vLQdzts6usUaqzXifGiaEYLq
dKDd2BeCIwzF5I99zH7Bk59WA5U5P30wAAAMEA79WY5tlna9rNElGS0O8tJVNWFXQ60Dt1
W5Z4OLxk23ea0OBB0aho6kUEgyfVdeIVZ6jbHIB8/lPLDidxm4PhfhIcOsIpX+NdttObV1
y+MW+TJA/70ARhumQqx+XNS+t+KNJ73YDhqa2I6e1CjoHclRhI4IAOMy4p1xk+HD59vLuO
fFLXKSZKaORiMQjqNfnMR2tCsio8poTIcWiP8GHmsvD0OoV+rLF2XcvO3/FZ0fOPVf8evo
XWFYkhMM4NNaBvAAAACGFjQGxvZ29zAQI=
-----END OPENSSH PRIVATE KEY-----
1

Nie wiem jaki format masz i jaki potrzebuesz (PEM, BER, DER) ale openssl umie je konwertować.

0

Niby jaki format nie podam i tak pokazuje ten sam fingerprint, ale się nie łączy :/

0

@_13th_Dragon: ale nie łączy się poprzez ssh clienta z linuksa?

0

Dokładnie, klucze próbowałem podawać w różnych formatach:

sftp -i ./orzin-private.id [email protected]
sftp -oIdentityFile=./orzin-private.id [email protected]

sftp -i ./orzin-private.rss [email protected]
sftp -oIdentityFile=./orzin-private.rss [email protected]

sftp -i ./orzin-private.ppk [email protected]
sftp -oIdentityFile=./orzin-private.ppk [email protected]

The authenticity of host '62.3.168.188 (62.3.168.188)' can't be established.
ECDSA key fingerprint is SHA256:EOne9sIa784B6s1X2AE3vme23WuWXUrWfwJWUg61ksU.
ECDSA key fingerprint is MD5:77:3f:52:49:59:14:18:ab:af:b5:fd:81:11:00:de:94.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Couldn't read packet: Connection reset by peer
The authenticity of host '62.3.168.188 (62.3.168.188)' can't be established.
ECDSA key fingerprint is SHA256:EOne9sIa784B6s1X2AE3vme23WuWXUrWfwJWUg61ksU.
ECDSA key fingerprint is MD5:77:3f:52:49:59:14:18:ab:af:b5:fd:81:11:00:de:94.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Couldn't read packet: Connection reset by peer
The authenticity of host '62.3.168.188 (62.3.168.188)' can't be established.
ECDSA key fingerprint is SHA256:EOne9sIa784B6s1X2AE3vme23WuWXUrWfwJWUg61ksU.
ECDSA key fingerprint is MD5:77:3f:52:49:59:14:18:ab:af:b5:fd:81:11:00:de:94.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Couldn't read packet: Connection reset by peer
The authenticity of host '62.3.168.188 (62.3.168.188)' can't be established.
ECDSA key fingerprint is SHA256:EOne9sIa784B6s1X2AE3vme23WuWXUrWfwJWUg61ksU.
ECDSA key fingerprint is MD5:77:3f:52:49:59:14:18:ab:af:b5:fd:81:11:00:de:94.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Couldn't read packet: Connection reset by peer
The authenticity of host '62.3.168.188 (62.3.168.188)' can't be established.
ECDSA key fingerprint is SHA256:EOne9sIa784B6s1X2AE3vme23WuWXUrWfwJWUg61ksU.
ECDSA key fingerprint is MD5:77:3f:52:49:59:14:18:ab:af:b5:fd:81:11:00:de:94.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Couldn't read packet: Connection reset by peer
The authenticity of host '62.3.168.188 (62.3.168.188)' can't be established.
ECDSA key fingerprint is SHA256:EOne9sIa784B6s1X2AE3vme23WuWXUrWfwJWUg61ksU.
ECDSA key fingerprint is MD5:77:3f:52:49:59:14:18:ab:af:b5:fd:81:11:00:de:94.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
Couldn't read packet: Connection reset by peer
1

Host key verification failed.

~/.ssh/known_hosts - wywal wpis dla tego klucza i spróbuj się ponownie podłączyć.

Gdyby nie pomogło, to zobacz w logi i pokaż co tam masz.

0

W związku z sugestjami od @.andy zmeniłem na:

sftp -i ./orzin-private.ppk -o "StrictHostKeyChecking=no"  -o "UserKnownHostsFile=/dev/null" [email protected]

i zaczęło się łączyć, czy da się tu w wierszu polecenia podać jeszcze Enter passphrase for key './orzin-private.ppk':?

Ciekawostką jest to że w pliku jest wpis:
Encryption: none


Po próbach kombinowania wg https://superuser.com/questio[...]-im-doing-ssh-operatio/990447

Przestało się łączyć :/
Jak cofnąć skutki kombinowania?

1

ssh-agent -k ?

0

$ ssh-agent -k
SSH_AGENT_PID not set, cannot kill agent

wcześniej killowałem przez kill -9

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0