Ssh Keys Linux

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Generate SSH KEY:
ssh-keygen -t ed25519 -C "Default key"

# Copy ssh key to server
ssh-copy-id -i ~/.ssh/id_ed25519.pub 172.16.3.106

# Use specific SSH key
ssh -i /.ssh/ansible 172.16.3.106

# get PID from ssh agent
eval $(ssh-agent)

# see of the ssh agent is running
ps aux | grep 2362

# add key phrase to ssh agent (works onlly for that terminal windows life)
ssh agent

# make alias from ssh agent
alias ssha='eval $(ssh-agent) && ssh-ad'

# add alias to .bashrc file to save the alias