lost RSA key after upgrade

Fórumok

Sziasztok!

Két gépen is upgrade történt, aminek következtében RSA(pub) key megváltozhatott. A két gép között a jelszó nélküli SCP nem működik, nem tudja hitelesíteni a távoli.
Csináltam új rsa key párt, átmásoltam a távolira, helyin hozzáadtam az agent-hez, mégsem jó valami.

Ami támpont lehet, hogy

ssh-add -l
2048 **:**:**:**:c7:44:c6:b1:d2:eb:b8:d9:02:1b:b9:4d /root/.ssh/id_rsa (RSA)

SCP .... parancsra következő:
The authenticity of host '[távoli gép]:22' can't be established.
RSA key fingerprint is **:**:**:**:32:ba:46:37:2c:85:c2:6f:85:ed:e7:87.

Tehát az SCP még valami rési RSA key-el próbál csatlakozni a távoli géphez, miközben már újat csináltam.

Hozzászólások

Jha, kifelejtettem, hogy a helyi gépen a ~/.ssh/known_hosts -ot kiürítettem, és ezek után legalább jelszóval tudok SCP-zni.

egyrészt az ssh-agent a te kulcsodat tárolja és annak ujjlenyomatát mutatja. Az általad feltüntetett login résznél meg a távoli host ujjlenyomatát mutatja. Tehát imho eddig rendben kellene lennie.

de amint látom, root-nak a kulcsát tároltad le az agent-be és root-ként akarsz bejelentkezni ezek szerint? Nem lehet hogy az upgrade során megváltozott a default policy, és a root login-t tiltja alapból?

ha igen, akkor /etc/ssh/sshd_config-ban "PermitRootLogin" "yes"-re, majd ssh restart.

Nem tudom mit tudnék kihalászni a dumpból.
De a lokál gép az jelszót kér...
ÉS VOLT hogy nem kérte, hanem sikerült belépnie magától. (Talán mikor a távolin be voltam lépve?)


22:50:56.724332 IP domain.hu.38002 > backup.2240: Flags [S], seq 3495199878, w in 5840, options [mss 1380,sackOK,TS val 29784668 ecr 0,nop,wscale 6], length 0
22:50:56.724363 IP backup.2240 > domain.hu.38002: Flags [S.], seq 560646899, a ck 3495199879, win 5792, options [mss 1460,sackOK,TS val 205637969 ecr 29784668, nop,wscale 5], length 0
22:50:56.729044 IP domain.hu.38002 > backup.2240: Flags [.], ack 1, win 92, op tions [nop,nop,TS val 29784669 ecr 205637969], length 0
22:50:56.737391 IP backup.2240 > domain.hu.38002: Flags [P.], seq 1:40, ack 1, win 181, options [nop,nop,TS val 205637972 ecr 29784669], length 39
22:50:56.741777 IP domain.hu.38002 > backup.2240: Flags [.], ack 40, win 92, o ptions [nop,nop,TS val 29784670 ecr 205637972], length 0
22:50:56.742028 IP domain.hu.38002 > backup.2240: Flags [P.], seq 1:40, ack 40 , win 92, options [nop,nop,TS val 29784670 ecr 205637972], length 39
22:50:56.742073 IP backup.2240 > domain.hu.38002: Flags [.], ack 40, win 181, options [nop,nop,TS val 205637973 ecr 29784670], length 0
22:50:56.742839 IP backup.2240 > domain.hu.38002: Flags [P.], seq 40:824, ack 40, win 181, options [nop,nop,TS val 205637973 ecr 29784670], length 784
22:50:56.747693 IP domain.hu.38002 > backup.2240: Flags [P.], seq 40:832, ack 40, win 92, options [nop,nop,TS val 29784671 ecr 205637973], length 792
22:50:56.786412 IP backup.2240 > domain.hu.38002: Flags [.], ack 832, win 231, options [nop,nop,TS val 205637985 ecr 29784671], length 0
22:50:56.786626 IP domain.hu.38002 > backup.2240: Flags [.], ack 824, win 116, options [nop,nop,TS val 29784675 ecr 205637973], length 0
22:50:56.791261 IP domain.hu.38002 > backup.2240: Flags [P.], seq 832:856, ack 824, win 116, options [nop,nop,TS val 29784675 ecr 205637985], length 24
22:50:56.791274 IP backup.2240 > domain.hu.38002: Flags [.], ack 856, win 231, options [nop,nop,TS val 205637986 ecr 29784675], length 0
22:50:56.793493 IP backup.2240 > domain.hu.38002: Flags [P.], seq 824:976, ack 856, win 231, options [nop,nop,TS val 205637986 ecr 29784675], length 152
22:50:56.798374 IP domain.hu.38002 > backup.2240: Flags [.], ack 976, win 141, options [nop,nop,TS val 29784676 ecr 205637986], length 0
22:50:56.801585 IP domain.hu.38002 > backup.2240: Flags [P.], seq 856:1000, ac k 976, win 141, options [nop,nop,TS val 29784676 ecr 205637986], length 144
22:50:56.823324 IP backup.2240 > domain.hu.38002: Flags [P.], seq 976:1696, ac k 1000, win 280, options [nop,nop,TS val 205637994 ecr 29784676], length 720
22:50:56.831616 IP domain.hu.38002 > backup.2240: Flags [P.], seq 1000:1016, a ck 1696, win 165, options [nop,nop,TS val 29784679 ecr 205637994], length 16
22:50:56.870416 IP backup.2240 > domain.hu.38002: Flags [.], ack 1016, win 280 , options [nop,nop,TS val 205638006 ecr 29784679], length 0
22:50:56.874609 IP domain.hu.38002 > backup.2240: Flags [P.], seq 1016:1064, a ck 1696, win 165, options [nop,nop,TS val 29784683 ecr 205638006], length 48
22:50:56.874660 IP backup.2240 > domain.hu.38002: Flags [.], ack 1064, win 280 , options [nop,nop,TS val 205638006 ecr 29784683], length 0
22:50:56.874718 IP backup.2240 > domain.hu.38002: Flags [P.], seq 1696:1744, a ck 1064, win 280, options [nop,nop,TS val 205638006 ecr 29784683], length 48
22:50:56.880158 IP domain.hu.38002 > backup.2240: Flags [P.], seq 1064:1128, a ck 1744, win 165, options [nop,nop,TS val 29784684 ecr 205638006], length 64
22:50:56.887191 IP backup.2240 > domain.hu.38002: Flags [P.], seq 1744:1808, a ck 1128, win 280, options [nop,nop,TS val 205638010 ecr 29784684], length 64
22:50:56.892997 IP domain.hu.38002 > backup.2240: Flags [P.], seq 1128:1496, a ck 1808, win 165, options [nop,nop,TS val 29784685 ecr 205638010], length 368
22:50:56.893835 IP backup.2240 > domain.hu.38002: Flags [P.], seq 1808:1872, a ck 1496, win 330, options [nop,nop,TS val 205638011 ecr 29784685], length 64
22:50:56.936589 IP domain.hu.38002 > backup.2240: Flags [.], ack 1872, win 165 , options [nop,nop,TS val 29784690 ecr 205638011], length 0

ssh -v:


debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to **************** port 2240.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu4
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '[*********]:2240' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password

ez lesz a hiba.

ha ezt a parancsot root-ként adod ki, akkor az oké hogy a távoli host-on a felh user-hez kapcsolódsz, viszont a root home-jából veszi a kulcsokat a helyi gépen természetesen. márpedig root-ként futtatod, a fenti log-okból ez derül ki nekem.

ha mindenképpen így kell, akkor másold be a root .ssh mappájába a kulcsaidat a helyi gépen. csak a tulaj mindengyiken root:root legyen, az .ssh mappán is, és a jogok is rendben legyenek.

szerk.: vagy az scp parancsnak a -i kapcsolóval megadhatod a forrás helyét a kulcsodnak, pl.:

scp -i /home/felh/.ssh/id_rsa file felh@host