MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / PrintSSHTunnelInstructions

Function PrintSSHTunnelInstructions

internal/util/ssh_helper.go:120–135  ·  view source on GitHub ↗

PrintSSHTunnelInstructions detects the IP address and prints SSH tunnel instructions for the user to connect to the local OAuth callback server from a remote machine. Parameters: - port: The local port number for the SSH tunnel

(port int)

Source from the content-addressed store, hash-verified

118// Parameters:
119// - port: The local port number for the SSH tunnel
120func PrintSSHTunnelInstructions(port int) {
121 ipAddress := GetIPAddress()
122 border := "================================================================================"
123 fmt.Println("To authenticate from a remote machine, an SSH tunnel may be required.")
124 fmt.Println(border)
125 fmt.Println(" Run one of the following commands on your local machine (NOT the server):")
126 fmt.Println()
127 fmt.Printf(" # Standard SSH command (assumes SSH port 22):\n")
128 fmt.Printf(" ssh -L %d:127.0.0.1:%d root@%s -p 22\n", port, port, ipAddress)
129 fmt.Println()
130 fmt.Printf(" # If using an SSH key (assumes SSH port 22):\n")
131 fmt.Printf(" ssh -i <path_to_your_key> -L %d:127.0.0.1:%d root@%s -p 22\n", port, port, ipAddress)
132 fmt.Println()
133 fmt.Println(" NOTE: If your server's SSH port is not 22, please modify the '-p 22' part accordingly.")
134 fmt.Println(border)
135}

Callers 4

LoginMethod · 0.92
LoginMethod · 0.92
LoginMethod · 0.92
LoginMethod · 0.92

Calls 1

GetIPAddressFunction · 0.85

Tested by

no test coverage detected