ployground / bsdploy

BSDploy is a tool to provision, configure and maintain FreeBSD jails.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

./bin/ploy ssh into ec2-instance is not working

s4ms0n opened this issue · comments

./bin/ploy ssh bsd
INFO: Instance 'bsd' (xxxxx) available.
ERROR: Fingerprint not in console output of xxxxx
ERROR: Failed to connect to ec2-instance:bsd (xxxxxxx)
ERROR: username: 'root'
ERROR: port: 22
ERROR: Couldn't validate fingerprint for ssh connection.
ERROR: Fingerprint doesn't match for xxxxxxx (got ['hex', 'SHA256:hash'], expected: ['auto'])
ERROR: Is the instance finished starting up?

if i use the above fingerprint, i am getting:
./bin/ploy ssh bsd
INFO: Instance 'bsd' (xxxxx) available.
ERROR: Failed to connect to ec2-instance:bsd (xxxxxxx)
ERROR: username: 'root'
ERROR: port: 22
ERROR: Couldn't validate fingerprint for ssh connection.
ERROR: Authentication failed.
ERROR: Is the instance finished starting up?

i can login via ssh as a root to the public DNS provided by ploy and ssh key
am i missing smth?

Is you public ssh key installed? By default ploy only uses public keys. You can add password-fallback = true in your instance config, but due to the way ploy does ssh connections, you may have to enter the password more than once when connecting.

Ah, I missed that you mentioned the ssh key in the last sentence. That's kind of weird then. It says "Authentication failed".

Could you manually check the ec2 console output though? I'd like to know if the fingerprints are actually not there or whether the format of the output changed again. You can use ploy debug -c instance to get the console output.

In case you are able to debug via pdb, then the ssh connection attempt where the error comes from is done in the ploy/plan.py Instance.init_ssh_key method. The line with client.connect uses paramiko to connect.

./bin/ploy debug -c bsd
INFO: Length of startup script: 551/16384
INFO: Instance 'bsd' (xxxxxxx) available.
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017
root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
VT(vga): text 80x25
XEN: Hypervisor version 4.2 detected.
CPU: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz (2400.04-MHz K8-class CPU)
Origin="GenuineIntel" Id=0x306f2 Family=0x6 Model=0x3f Stepping=2
Features=0x1783fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,HTT>
Features2=0xfffa3203<SSE3,PCLMULQDQ,SSSE3,FMA,CX16,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND,HV>
AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
AMD Features2=0x21<LAHF,ABM>
Structured Extended Features=0x728<BMI1,AVX2,BMI2,ERMS,INVPCID>
XSAVE Features=0x1
Hypervisor: Origin = "XenVMMXenVMM"
real memory = 536870912 (512 MB)
avail memory = 477114368 (455 MB)
Event timer "LAPIC" quality 100
ACPI APIC Table:
ioapic0: Changing APIC ID to 1
MADT: Forcing active-low polarity and level trigger for SCI
ioapic0 <Version 1.1> irqs 0-47 on motherboard
Timecounter "TSC-low" frequency 1200021753 Hz quality 800
taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0
taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0
random: entropy device external interface
kbd1 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff80f5b220, 0) error 19
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
nexus0
vtvga0: on motherboard
cryptosoft0: on motherboard
acpi0: on motherboard
acpi0: Power Button (fixed)
acpi0: Sleep Button (fixed)
cpu0: on acpi0
hpet0: iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 62500000 Hz quality 950
attimer0: port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <32-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0
pcib0: port 0xcf8-0xcff on acpi0
pci0: on pcib0
isab0: at device 1.0 on pci0
isa0: on isab0
atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc100-0xc10f at device 1.1 on pci0
ata0: at channel 0 on atapci0
ata1: at channel 1 on atapci0
pci0: at device 1.3 (no driver attached)
vgapci0: mem 0xf0000000-0xf1ffffff,0xf3000000-0xf3000fff at device 2.0 on pci0
vgapci0: Boot video device
xenpci0: port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 28 at device 3.0 on pci0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse Explorer, device ID 4
fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: does not respond
device_attach: fdc0 attach returned 6
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (9600,n,8,1)
xenpv0: on motherboard
granttable0: on xenpv0
xen_et0: on xenpv0
Event timer "XENTIMER" frequency 1000000000 Hz quality 950
Timecounter "XENTIMER" frequency 1000000000 Hz quality 950
xenstore0: on xenpv0
evtchn0: on xenpv0
privcmd0: on xenpv0
debug0: on xenpv0
vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
fdc0: No FDOUT register!
ppc0: cannot reserve I/O port range
Timecounters tick every 1.000 msec
usb_needs_explore_all: no devclass
nvme cam probe device init
xenballoon0: on xenstore0
xctrl0: on xenstore0
xs_dev0: on xenstore0
xenbusb_front0: on xenstore0
xn0: at device/vif/0 on xenbusb_front0
xn0: Ethernet address: 02:15:0e:88:96:50
xenbusb_back0: on xenstore0
xn0: backend features: feature-sg feature-gso-tcp4
xbd0: 10240MB at device/vbd/768 on xenbusb_front0
xbd0: attaching as ada0
Trying to mount root from ufs:/dev/gpt/rootfs [rw]...
GEOM: ada0: the secondary GPT header is not in the last LBA.
random: unblocking device.
xn0: link state changed to DOWN
xn0: link state changed to UP
Waiting (max 60 seconds) for system process vnlru' to stop... done Waiting (max 60 seconds) for system process bufdaemon' to stop... done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining... 1 0 done
All buffers synced.
Uptime: 1m46s
Rebooting...
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE-p7 #0: Tue Mar 6 09:33:30 UTC 2018
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
VT(vga): text 80x25
XEN: Hypervisor version 4.2 detected.
CPU: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz (2400.04-MHz K8-class CPU)
Origin="GenuineIntel" Id=0x306f2 Family=0x6 Model=0x3f Stepping=2
Features=0x1783fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,HTT>
Features2=0xfffa3203<SSE3,PCLMULQDQ,SSSE3,FMA,CX16,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND,HV>
AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
AMD Features2=0x21<LAHF,ABM>
Structured Extended Features=0x728<BMI1,AVX2,BMI2,ERMS,INVPCID>
XSAVE Features=0x1
Hypervisor: Origin = "XenVMMXenVMM"
real memory = 536870912 (512 MB)
avail memory = 477110272 (455 MB)
Event timer "LAPIC" quality 100
ACPI APIC Table:
random: unblocking device.
ioapic0: Changing APIC ID to 1
MADT: Forcing active-low polarity and level trigger for SCI
ioapic0 <Version 1.1> irqs 0-47 on motherboard
Timecounter "TSC-low" frequency 1200021166 Hz quality 800
taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0
taskqgroup_adjust failed cnt: 1 stride: 1 mp_ncpus: 1 smp_started: 0
random: entropy device external interface
kbd1 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff80f5b220, 0) error 19
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
nexus0
vtvga0: on motherboard
cryptosoft0: on motherboard
acpi0: on motherboard
acpi0: Power Button (fixed)
acpi0: Sleep Button (fixed)
cpu0: on acpi0
hpet0: iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 62500000 Hz quality 950
attimer0: port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <32-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0
pcib0: port 0xcf8-0xcff on acpi0
pci0: on pcib0
isab0: at device 1.0 on pci0
isa0: on isab0
atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc100-0xc10f at device 1.1 on pci0
ata0: at channel 0 on atapci0
ata1: at channel 1 on atapci0
pci0: at device 1.3 (no driver attached)
vgapci0: mem 0xf0000000-0xf1ffffff,0xf3000000-0xf3000fff at device 2.0 on pci0
vgapci0: Boot video device
xenpci0: port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 28 at device 3.0 on pci0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse Explorer, device ID 4
fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: does not respond
device_attach: fdc0 attach returned 6
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (9600,n,8,1)
xenpv0: on motherboard
granttable0: on xenpv0
xen_et0: on xenpv0
Event timer "XENTIMER" frequency 1000000000 Hz quality 950
Timecounter "XENTIMER" frequency 1000000000 Hz quality 950
xenstore0: on xenpv0
evtchn0: on xenpv0
privcmd0: on xenpv0
debug0: on xenpv0
vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
fdc0: No FDOUT register!
ppc0: cannot reserve I/O port range
Timecounters tick every 1.000 msec
usb_needs_explore_all: no devclass
nvme cam probe device init
xenballoon0: on xenstore0
xctrl0: on xenstore0
xs_dev0: on xenstore0
xenbusb_front0: on xenstore0
xn0: at device/vif/0 on xenbusb_front0
xn0: Ethernet address: 02:15:0e:88:96:50
xenbusb_back0: on xenstore0
xn0: backend features: feature-sg feature-gso-tcp4
xbd0: 10240MB at device/vbd/768 on xenbusb_front0
xbd0: attaching as ada0
Trying to mount root from ufs:/dev/gpt/rootfs [rw]...
xn0: link state changed to DOWN
xn0: link state changed to UP

FreeBSD/amd64 (ip-172-31-13-169) (ttyu0)

login:

looks like ssh connection. where do i find plan.py? i can not find Instance.init_ssh_key call

Thanks, was able to solve the mystery: missing ssh-key-filename option :)