Auto-login with Putty.exe

1

1

I have Windows 7 running on my PC, and am using Putty.exe to connect to Red-Hat server, somewhere along the network. Usually, I double-click the Putty.exe file, choose a session, and press 'open'. Then I entered my username and password, and was ready-to-go. I want to automate this process.

So, I've done some reading (even on similar questions asked over here), and tried the command-line approach. In the command line I typed in:

Putty.exe myusername@myserver -pw mypass

But got "putty Fatal error": 'unable to authenticate' error.

I'm guessing that I'm using the SSH protocol, trying to connect from the command line, but don't know which SSH (1 or 2), and don't think it matters. I've read about private-key/public-key method, but as for now - I want to stick with the username/password method.

Thanks to Celeritas' comment, I've tried to used auto-login method in Putty window - but got only 'Auto-login username' field, and not 'Auto-login password'. Also worth mentioning is the fact that I've got only the Putty.exe file, and without other helping tools, such as PuTTYgen.exe.

Thank you.

Bak Itzik

Posted 2015-11-25T06:31:18.870

Reputation: 13

2

See here http://superuser.com/questions/999936/auto-connecting-to-remote-machine

– Celeritas – 2015-11-25T06:36:17.407

Thanks, but no help from there. Updated my Q to explain. – Bak Itzik – 2015-11-25T06:52:33.510

2Are there special characters on your username or password? Command line might interpret them wrongly and send wrong symbols to the server. – Madoc Comadrin – 2015-11-25T06:55:26.463

1@MadocComadrin: Thank you! You solved it. I had '&' in the password. Once I encapsulated it with "" - it worked. (And now everybody knows one char in my pass :) – Bak Itzik – 2015-11-25T07:05:49.577

Answers

0

I post my comment as answer too so the question can be marked as solved:

Are there special characters on your username or password? Command line might interpret them wrongly and send wrong symbols to the server.

Madoc Comadrin

Posted 2015-11-25T06:31:18.870

Reputation: 928

1

I suggest to rather configure SSH keys authentication than login credentials remembering.

It's not that much complicated:

  • Generate a key with PuTTYgen.
  • Put you public key to RedHat server.
  • Add private key to PAGEANT.
  • Setup PuTTY.

g2mk

Posted 2015-11-25T06:31:18.870

Reputation: 1 278

Thanks, but it already solved by @Madoc Comadrin. Stupid 'special character' problem. And as I wrote - I don't have PAGEANT, nor the willing to setup private/public key right now. – Bak Itzik – 2015-11-25T07:08:24.890

0

Auto-login to PUTTY SSH session using a .BAT file

Create a one-line batch file in any text editor:

@start putty -load "mySavedSession" -l yourusername -pw yourpassword


More info:

ashleedawg

Posted 2015-11-25T06:31:18.870

Reputation: 395