The best way to do that would be to set up keys
From your local machine
You can enter through the passphrase bit because if you use a passphrase then you will have to type it which defeats the object. ThenCode:ssh-keygen
You will have to type the servers password this time but after that you won't.Code:ssh-copy-id mohan@ip.address.of.server
i tried this but is it correct??
Code:ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/krishna/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/krishna/.ssh/id_rsa. Your public key has been saved in /home/krishna/.ssh/id_rsa.pub. The key fingerprint is: bc:27:80:fb:8c:5c:d0:46:18:0d:94:c8:27:d0:37:17 krishna@ubuntu The key's randomart image is: +--[ RSA 2048]----+ |.+ o++E. | | = =oo | | +.o. | | + . | | o + S | | + . . | | . . o . | | . = o | | o o | +-----------------+
yep, that looks good. Then
or what ever the ip address is.Code:ssh-copy-id mohan@192.168.?.?
This is what the output is
what should i do after this?Code:ssh-copy-id mohan@10.40.70.68 mohan@10.40.70.68's password: Now try logging into the machine, with "ssh 'mohan@10.40.70.68'", and check in: ~/.ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
That's right.
You should now be able to login or scp from that server without a password.
yep
You are creating a pair of keys. You send one to the server and you have one on your local machine. When you attempt to connect to the server via ssh (which includes scp) the server asks if you have a key. You show it your key and it checks it against the one you sent it. Because they match up, the server knows it's you and lets you in ...........
........ sort of.
Keys are generated with fancy random maths stuff and are much more secure than passwords. There is some information on the wiki
https://help.ubuntu.com/community/SSH/OpenSSH/Keys
Somewhere on this forum is a very good analogy that explains gpg, keys and all this stuff really well but I can't find it right now.
Bookmarks