user1551817
user1551817

Reputation: 7451

Have password automatically entered when ssh

From my laptop, I often ssh into another machine in my university department. I have to put in a password every time currently.

Could someone give me an idiot's guide to having the password be automatically entered each time I log in please.

Thank you in advance.

Upvotes: 1

Views: 1356

Answers (5)

Jim Fell
Jim Fell

Reputation: 14256

Assuming you're using a Bash terminal, it's actually pretty simple. Use ssh-copy-id. For example:

ssh-copy-id -i ~/.ssh/id_rsa.pub <user@remote-host>

This will copy your public key to the remote host, so you shouldn't need to enter your password every time you login.

Upvotes: 0

user1455836
user1455836

Reputation: 752

You can log in without providing password if PKI (public key infrastructure) is set up.

Otherwise you'll have to look for ssh client that can store passwords and supports your operating system.

Upvotes: 2

Srini V
Srini V

Reputation: 11355

You can override by enabling Password less authentication. But you should install keys (pub, priv) before going for that.

Execute the following commands at local server.

Local $> ssh-keygen -t rsa 

Press ENTER for all options prompetd. No values need to be typed.

Local $> cd .ssh
Local $> scp .ssh/id_rsa.pub user@targetmachine:
Prompts for pwd$>  ENTERPASSWORD

Connect to remote server using the following command

Local $> ssh user@targetmachine
Prompts for pwd$> ENTERPASSWORD

Execute the following commands at remote server

Remote $> mkdir .ssh
Remote $> chmod 700 .ssh
Remote $> cat id_rsa.pub >> .ssh/authorized_keys
Remote $> chmod 600 .ssh/authorized_keys
Remote $> exit

Execute the following command at local server to test password-less authentication. It should be connected without password.

$> ssh user@targetmachine

Upvotes: 3

Roy Dictus
Roy Dictus

Reputation: 33139

Use a tool (such as AutoHotkey, assuming you are using Windows) to record and replay key sequences: http://www.autohotkey.com/

Upvotes: 0

frigo
frigo

Reputation: 107

I assume you are using Linux. Lot of places in the internet where it is already documented.

For example(s):

http://www.rebol.com/docs/ssh-auto-login.html

http://www.linuxproblem.org/art_9.html

Upvotes: 2

Related Questions