ฉันจะเขียนคำสั่งต่อไปนี้อีกครั้งด้วยได้ProxyCommand
อย่างไร?
ssh -l username1 -t jumphost1 \
ssh -l username2 -t jumphost2 \
ssh -l username3 -t jumphost3 \
ssh -l username4 server
มันใช้งานไม่ได้
ssh -o ProxyCommand="\
ssh -l username1 -t jumphost1 \
ssh -l username2 -t jumphost2 \
ssh -l username3 -t jumphost3" \
-l username4 server
username1@jumphost1's password:
Pseudo-terminal will not be allocated because stdin is not a terminal.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
ssh_exchange_identification: Connection closed by remote host
ฉันรู้ของการใช้งานที่มีnc
แต่ฉันมองหาวิธีที่จะใช้กับ 3+ scp
ฮ็อพและยังใช้ตัวเลือกนี้ด้วย ฉันตรวจสอบssh_config
หน้าคน แต่ข้อมูลค่อนข้างหายากสำหรับฉันอย่างน้อย
แก้ไข
ฉันพยายามใช้ProxyCommand
ซ้อนกันProxyCommand
ตามที่แนะนำด้านล่าง แต่ฉันได้รับบางอย่างตามบรรทัดต่อไปนี้
debug3: ssh_init_stdio_forwarding: 192.17.2.2:2222
debug1: channel_connect_stdio_fwd 192.17.2.2:2222
debug1: channel 0: new [stdio-forward]
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: getpeername failed: Bad file descriptor
debug3: send packet: type 90
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
โชคดีที่ตั้งแต่7.3
-J
หรือตอบProxyJump
สนองวัตถุประสงค์ของฉัน - แม้ว่าฉันจะต้องแก้ไขการตั้งค่าคีย์ของฉัน
ssh -q -J user1@jumphost1,user2@jumphost2,user3@jumphost3 user@server