|
|
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
Помогите, пожалуйста, решить проблему с ssh. Задача следующая - есть RSA-ключ, по которому я хожу на сервер1 и сервер2. Как указать ssh'у, чтобы при подключении к сервер1 пробросился мой ключ и оттуда я смог бы подключиться к сервер2? Подключаюсь след. образом: ssh -A сервер1 При этом 'ssh-add -l' там показывает '2047 1c:46:8b:... /home/andrew/.ssh/id_rsa (RSA)' Однако при подключении оттуда 'ssh -A сервер2' идёт запрос пароля сервера. Со своей машины на сервер2 подключение проходит. Как сделать так, чтобы пробрасывался ключ и использовался для входа на сервер2? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.06.2009, 21:37 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
ADjo Чушь какая-то. У тебя есть public и private ключ? Есть. Ну так и записывай в ~/.ssh/authorized_keys на server2 (1) соотвествующие public ключи от server1 (2). Соотвествующие ~/.ssh/id_rsa, т.е. которые рядом, в ~/.ssh/id_rsa.pub лежат из server2 в server1, и наоборот, из server1 в server2. А автоматом оно ничо пробрасывать не будет, это глюпость патамушо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.06.2009, 21:46 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
До Ubuntu OS стояла винда 7-я. Ходил через Putty таким образом, всё работала. В настройках указывал forwarding и ключ пробрасывался и шло поключение к сервер2 с сервера1. Хочу также сделать в nix-ах. Если бы у меня была возможность сделать отдельно ключи для сервер1 и сервер2 я бы сделал. Любитель, что тебе не понятно??? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 12:28 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
ADjo, IMHO бред ) есть ssh на обе машины и что мешает положить туда ключи непонятно ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 12:31 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
Вам нужно почитать про ssh-agent, добавить в него ключ и разрешить agent forwarding -- „Истина — это вовсе не то, что можно убедительно доказать, это то, что делает всё проще и понятнее“ — Антуан де Сент-Экзюпери ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 12:37 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
На сервер1 дан пароль root'a. Оттуда мне нужно вытягивать git-репозитроий с сервер2, к которому идет авторизация по моему ключу . Когда стояла 7-ка через putty проблем не было 'пробросить' ключ и вытянуть репозиторий. На Ubuntu тот же фокус не проходит. Я понимаю, что это всё в корне не правильно. Что нужно создавать отдельного пользователя на сервер1 и делать отдлеьные ключи для входа с сервер1 на сервер2. Но я тут всего-лишь девелопер. Мне дали пароль рута и есть ключ на вход к сервер1\2. Через Putty это всё работает... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 12:44 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
а прошу прощенья, не внимательно прочтал Ваш первый пост, Вы уже включили агента и проверили что ключи форвардятся на сервер1 %) попробуйте посмотреть что выдаёт ssh -v сервер2 с сервер1 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 12:47 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
ssh -v сервер2 c сервер1 дал: debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_dsa type -1 ... debug1: Host ' сервер2 ' is known and matches the RSA host key. debug1: Found key in /root/.ssh/known_hosts:3 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,gssapi-with-mic,password debug1: Next authentication method: gssapi-with-mic debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/identity debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Next authentication method: password сервер2 .it's password: ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 13:02 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
Больше vvv ssh -vvv сервер2 там типа такого должно появляться debug1: Offering public key: debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 15:28 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
не видит он агента... хмм.. Вы точно вот это делали от рута: ADjoПри этом 'ssh-add -l' там показывает '2047 1c:46:8b:... /home/andrew/.ssh/id_rsa (RSA)' ? может быть Вы в запарке смотрели ssh-add -l на сервере1 от обычного пользователя и подключались к серверу1 как обычный пользователь, а не root ? больше у меня вариантов нет :) ps: пробовал у себя - работает. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 15:33 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
На локальной машине: andrew@andrew:~$ ssh-add -l 2047 1c:46 ... :e9 /home/andrew/.ssh/id_rsa (RSA) Подключение к сервер2 : andrew@andrew:~$ ssh -vvv andrew@ сервер2 ... debug2: key: /home/andrew/.ssh/id_rsa (0xb8ab1f90) ... debug1: Offering public key: /home/andrew/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 276 debug2: input_userauth_pk_ok: fp 1c:... :e9 debug3: sign_and_send_pubkey debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Trying private key: /home/andrew/.ssh/id_rsa debug1: PEM_read_PrivateKey failed debug1: read PEM private key done: type <unknown> Enter passphrase for key '/home/andrew/.ssh/id_rsa': debug1: read PEM private key done: type RSA debug3: sign_and_send_pubkey debug2: we sent a publickey packet, wait for reply debug1: Authentication succeeded (publickey). ... [andrew@ сервер2 ~]$ exit Подключение к сервер1 и с него на сервер2 : andrew@andrew:~$ ssh -A root @ сервер1 сервер1:~# ssh-add -l 2047 1c:.. :e9 /home/andrew/.ssh/id_rsa (RSA) сервер1 :~# ssh -vvv andrew@ сервер2 ... debug2: key: /home/andrew/.ssh/id_rsa (0x809b900) .... debug1: Next authentication method: publickey debug1: Offering public key: /home/andrew/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 276 debug2: input_userauth_pk_ok: fp 1c:.. :e9 debug3: sign_and_send_pubkey debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Trying private key: /root/.ssh/identity debug3: no such identity: /root/.ssh/identity debug1: Trying private key: /root/.ssh/id_rsa debug3: no such identity: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug3: no such identity: /root/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup password andrew@сервер2.it's password: Я так понимаю не хватает debug1: Trying private key: /home/andrew/.ssh/id_rsa ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 16:46 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
вряд ли, у меня аутентификация заканчивается сразу после sign_and_send_pubkey: debug1: Offering public key: /home/andrew/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 276 debug2: input_userauth_pk_ok: fp 1c:.. :e9 debug3: sign_and_send_pubkey debug1: Authentication succeeded (publickey). -- „Истина — это вовсе не то, что можно убедительно доказать, это то, что делает всё проще и понятнее“ — Антуан де Сент-Экзюпери ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 17:22 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
тремя строчками ниже, причем надо смотреть лог ssh сервера, или дебаг на нем включать. у меня так debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 277 debug2: input_userauth_pk_ok: fp ................. debug3: sign_and_send_pubkey debug1: Authentication succeeded (publickey). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 17:24 |
|
||
|
ssh forwarding
|
|||
|---|---|---|---|
|
#18+
Любитель смешных дурачков, уважаемый, Вы руководства читали? man-A Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file. Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent’s Unix-domain socket) can access the local agent through the forwarded connection. An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.06.2009, 18:50 |
|
||
|
|

start [/forum/topic.php?fid=25&fpage=122&tid=1485744]: |
0ms |
get settings: |
9ms |
get forum list: |
20ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
44ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
51ms |
get tp. blocked users: |
2ms |
| others: | 223ms |
| total: | 375ms |

| 0 / 0 |
