2

I've been using nothing but Windows for years. I'm transitioning to Linux and I'm trying to make the transition as easy as possible since I have almost no knowledge of Linux.

On Windows, I currently use desktop shortcuts with PuTTY as a quick and easy way to connect to different proxy servers. I have created shortcuts for PuTTY that allow me to simply double-click them which opens PuTTY, which connects to the server and supplies the username and password. Pretty much what is being done in this article: http://web.archive.org/web/20201203103040/http://jafty.com/blog/how-to-make-putty-automatically-login-with-user-and-password/

I need to forward certain local ports to certain ports on the proxy servers (e.g., L8888->localhost:2222) so I can specify multiple HTTP and SOCKS proxy settings in browsers and other apps.

Is there a way to mimic this "auto-login" that I'm doing on the Windows box or is there a better, more secure way of doing this on Ubuntu? The usernames and passwords are very complex and I need to connect and disconnect frequently. Unfortunately, I have no control over the servers so usernames/passwords have to be used.

Jeff
  • 121

1 Answers1

3

Unfortunately, I have no control over the servers so usernames/passwords have to be used.

No, your servers likely have key-based authentication enabled. See How can I set up password-less SSH login? on setting it up, so you can skip using passwords and use keys. (If you absolutely must use passwords for some insane reason, see another answer in that post using ssh-pass.

Then, you can create entries in ~/.ssh/config like so:

Host proxy1
     Hostname some.server.or.ip
     User foo
     LocalForward 8888 localhost:2222

Here proxy1 can be any name you choose, but Hostname should contain the actual server hostname or IP. (See man ssh_config for more options.) Having done that, in a terminal, do ssh proxy1 in a terminal to start the port forwarding, and press CtrlD to quit (or run exit).

Or see Create a .desktop file that opens and execute a command in a terminal on how to start commands in a terminal from a shortcut (or "launcher").

Of course, putty is available for Ubuntu.

muru
  • 207,228