henyxia / open-bastion

An open source bastion solution
GNU General Public License v3.0
1 stars 0 forks source link

Merge 2nd poc #12

Closed Fraise closed 4 years ago

henyxia commented 4 years ago

Also, just using the following command crash the bastion: ssh -p 2022 127.0.0.1 bastion server:

2020/03/08 11:49:22 Wait for a new connection
panic: runtime error: slice bounds out of range

goroutine 21 [running]:
main.(*Client).handleSSHConnexion(0xc00010e2c0, 0x0, 0x0)
    /home/henyxia/git/src/github.com/open-bastion/open-bastion/cmd/open-bastion/main.go:176 +0x7b0
main.main.func1(0xc000084540, 0xc00008e6d0, 0xc00009b1e0)
    /home/henyxia/git/src/github.com/open-bastion/open-bastion/cmd/open-bastion/main.go:97 +0xf8
created by main.main
    /home/henyxia/git/src/github.com/open-bastion/open-bastion/cmd/open-bastion/main.go:86 +0x435
exit status 2
henyxia commented 4 years ago

With the current code, connection to an IP directly fails. command:

ssh -p 2022 127.0.0.1 ssh root@10.3.2.8

And from the logs:

dial tcp: lookup 10.3.2.8: no such host