ssh proxy route connection by ssh options SendEnv ?
i want to use that porject as a ssh router , my mutli backend or upstream linux server has a same user account. so i am going to use client command like that "ssh user@proxy_address -p 2222 -o SendEnv=upstream_addr -o SendEnv=upsream_port " to connect the proxy server ,and than the server will route connection by env . how to do that at this project?
hi, here is how I would translate your situation with the use I make of this project:
ssh user_upstreamIdentifier@proxy_address -p 2222
with following impl:
func FindUpstreamByUsername(username string) (string, error) {
parts := strings.Split(username, "_")
if len(parts) == 2 {
host := parts[1]
if host == "upstream1" {
return "10.0.0.5" // or net.LookupHost(host)...
}
}
return "", errors.New("access denied")
}
hi, thranks for your answer, but my background is my upstreams server have a same account for login. in your example, that username actually pass to upstream server is difference. can you have some method to impl my purpose?
hi, thranks for your answer, but my background is my upstreams server have a same account for login. in your example, that username actually pass to upstream server is difference. can you have some method to impl my purpose?
Ok from what I understand of your requirement and this project what you want is not possible as sshr is "just tunneling" the network traffic (incl. original username) to a host...
@tsurubee am I right ?