1. Create Windows Shortcut
Begin by creating a Windows Shortcut.
Right-click the Desktop, select New and Shortcut.
Click Browse and navigate to the PuTTY folder.
It’s usually located in C:\Program Files\PuTTY or C:\Program Files (x86)\PuTTY
Select putty.exe, click OK and Next.
Enter a name for you shortcut. e.g. LinuxServer and click Finish.
2. Edit Shortcut
Right-click on your new shortcut and click Properties.
Take note of the Target field. It shows the path to putty.exe in Program Files. We are going to add a switch to this.
After the double quotes, paste in the following
-ssh [email protected] -pw PaSsWoRd
Replace john
with your username, 192.168.1.10
with your server IP and PaSsWoRd
with your own password.
The Target field should now look something like this. (Your path may differ depending on where putty.exe is installed.)
"C:\Program Files\PuTTY\putty.exe" -ssh [email protected] -pw PaSwOrD
Click OK and you’re done!
Now when you double-click the shortcut it will bring you straight into your Linux server without having to enter username or password.
Consider Key-based Authentication
Storing your password in a Windows shortcut is not very secure though, is it?
As well as offering additional security, SSH key authentication can be more convenient than the more traditional password authentication. SSH keys can allow you to connect to a server, or multiple servers, without having to remember or enter your password for each system.
Disable Sudo Password Prompt or Extend Timeout in Linux
Every time you issue a sudo
command, Linux asks for your user password after a certain inactivity timeout, usually 5 minutes. This is the recommended behaviour to prevent unauthorised commands being run by someone or a malicious script in your absence. However, this requirement can be disabled per session or permanently, or you can extend the inactivity timeout.
VNC via a PuTTY SSH Tunnel
If you’re using Ubuntu, I’ve written a guide for installing a VNC server and connecting to it through a secure SSH Tunnel using PuTTY. 😎
Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.
Hi,
Thanks, this is very useful. May I ask what if the server uses a different port instead of 22
Is there away to change the default port
In addition to password, I’m setting dynamic port forwarding for FoxyProxy SOCKS proxy use (with -D 1234), but would like to start puTTY with one of its SSH bug-compatibility mode flags set to On, particularly the ‘Chokes on PuTTY’s SSH-2 ‘winadj’ requests’.
In a saved session with this flag set to On, I notice the BugWinadj REG_DWORD registry key has a value of 2
Can you think of a way to invoke puTTY with this flag set from a shortcut?
Thanks for any help!
Is it possible to save passoword in a file
like:
“C:Program FilesPuTTYputty.exe” -load web-server -pw “C:Program FilesPuTTYpw”
Creating youself a key pair for SSH and disabling password based login is greatly advised.
If you really want to create this autologin file, other than leaving an handy way to login to some intruder in your machine, do it with the key string then, at least you can then disable it in a cleaner way
Thank you, Edit Shortcut work with my win10 laptop.
Regards,
I would like to enter my session (“Cole”) details (user name “ME”, password “234”); then on the next screen enter my details (user name “ME”, password “567”). then with the same defined pages, enter there parameters and set to download in excel (3 pages in total) using excel vba.
is this possible?
It works good, thanks
Thank you so much with this el i m able to save my password
how do you open it directly to the destination folder, for example
\var\www\test\
You can use the
-m
and-t
switches, and a simple text file containing your commands.Target example:
In
cmd.txt
, add your command. We also need to run/bin/bash
to start the shell:-m
instructs PuTTY and the SSH server to run a command instead of a shell. That’s why we have to use-t
override to force PuTTY to start the shell, and/bin/bash
incmd.txt
to force the SSH server to also start the shell.I can get the login part to work just fine – but as soon as I add the
-m "C:\Users\john\Desktop\cmd.txt" -t
part the shortcut can’t login. The putty is just waiting for me to enter the password manually – any advice?How to input PaSwOrD having double quotes in it ( ” ) ?
You may have to escape some special characters such as
"
with a single backslash\
.For example, if your password is
1234"1234
, then your target will be:Thank you for this!!!
this works very well but is there a way to setup logging for the shortcut’s after doing this?
Not sure what you mean. Can you explain what you want to achieve?
Thank you for this. I had a profile setup with custom colors and font, is there a way to use this saved name/password with the custom colors/font?
There is no command line switch for font style that I know of but you can instead save a PuTTY session with your IP, username and font preference, and then load the session with password using:
I’ve just tested this and it works.
thanks for this trick, smart! also useful for using shh key connections which need more modifications in session
thank u so much -ssh was saying incoorect path ‘-load’ worked here
Thanks for post, is there way to save password for multiple host?
windows 10 gives an error message about invalid path & won’t allow the change.
Nevermind fix problem.
How did you fixed? I get error that the path is not correct
yes this helped a lot, what would be even better is automate task with this add on now.