using System; using System.Diagnostics; class Program { static void Main(string[] args) { if (args.Length < 6) { Console.WriteLine("Uso: program "); return; } string sshHost = args[0]; // Host do servidor SSH string sshUser = args[1]; // Usuário SSH string localPort = args[2]; // Porta local string remotePort = args[3]; // Porta remota string certkey = args[4]; string sshExe = args[5]; string sshPassword = "senha"; // Gerenciar senha de maneira segura string command = $"{sshExe} -ssh {sshUser}@{sshHost} -pw {sshPassword} -L {localPort}:localhost:{remotePort} -i {certkey}"; // Executa o comando Process.Start(new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/C " + command, CreateNoWindow = true, UseShellExecute = false }); Console.WriteLine("Túnel SSH aberto."); } }