I am trying to set up my SSH keys for GitHub and created a new SSH key for the same. I have managed to setup the SSH key but I wish to retain these settings and save them in the configuration file ~/.ssh/config
which is not available. Where can I add this key path to retain the configuration?
My problem is : I developed successfully RSA Key based ssh login on board from system. When a client logs in for the first time, ask about private key and passphrase also which works fine. In second time login, ssh doesn't ask private key or password, directly login on board.
Client side use Ubuntu 16.04 and on board customizes Ubuntu.
First time login with below command:
ssh -i ~/.ssh/id_rsa user@board_ip
//works fine
Second time:
ssh user@board_ip
//never ask password and public key - problem
First time:
ssh user@board_ip
//not able to login without key - works fine
As per my understanding, I made a mistake in the sshd_config file on the board. I played with below settings but failed it all the time.
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#PasswordAuthentication yes
PermitEmptyPasswords no
Project requirement is secure login, mainly on ssh. To achive more security SSH password based login, we shifted to key based login. As explain above after change all configuration. SSH login require private key and password also. After logout and after sometime login again, ssh doesn't require key or password, project requirement need key and password each and everytime.
I just installed Ubuntu 14.04 on my server and I was setting up all my config files when I came across this in my sshd_config
file:
# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes
This made me very worried. I thought that it was possible that someone could be logging into my server as root without a password.
I tried connecting to my server as root via:
johns-mbp:~ john$ ssh [email protected]
The authenticity of host '192.168.1.48 (192.168.1.48)' can't be established.
RSA key fingerprint is 40:7e:28:f1:a8:36:28:da:eb:6f:d2:d0:3f:4b:4b:fe.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.48' (RSA) to the list of known hosts.
[email protected]'s password:
I entered a blank password and it didn't let me in, which was a relief. So my question is: what does without password mean and why is this a default in Ubuntu 14.04?
I've written this small utility script:
for h in $SERVER_LIST; do ssh $h "uptime"; done
When a new server is added to $SERVER_LIST
, the script is stopped with:
The authenticity of host 'blah.blah.blah (10.10.10.10)' can't be established.
RSA key fingerprint is a4:d9:a4:d9:a4:d9a4:d9:a4:d9a4:d9a4:d9a4:d9a4:d9a4:d9.
Are you sure you want to continue connecting (yes/no)?
I've tried yes
:
for h in $SERVER_LIST; do yes | ssh $h "uptime"; done
with no luck.
Is there a way to parametrize ssh
to automatically accept any new key?
I set up my Linux server to accept connections from my home PC by adding the public key generated by PuTTYgen to the authorized_keys
file.
Now I'm trying to connect to the same machine, but this time from another Ubuntu machine. I have to use the same private key (for a weird reason, don't ask..) and I don't quite get how to install it on my client Ubuntu.
Do I have to convert it to some other format?