Known Fingerprint is use to verify the server’s identity to the client
Install
sudo apt-get install openssh-server
sudo apt install openssh-client
sudo apt-get update
sudo service ssh start
Install the SSH public key on the node#
sudo cat $HOME/.ssh/id_rsa.pub | ssh rke@172.18.3.10 "tee -a /home/rke/.ssh/authorized_keys"
Banner Login/Logout
/etc/issue.net
# write:
# Unauthorized access to this server is prohibited. All the activites are being logged
# exit
/etc/ssh/sshd_config
# add:
Banner /etc/issue.net
PrintMotd yes
# exit
nano /etc/motd
/etc/init.d/ssh restart
ssh user@ip
Disable root connection
sudo nano /etc/ssh/sshd_config
PermitRootLogin #yes/no/without-password
Blacklist users from ssh
/etc/ssh/sshd_config
# search AllowUser
AllowUsers arman user1
# exit nano
/etc/init.d/ssh restart
Example scp
scp/home/ubuntu1604rzero/MyIndexRancher/Scripts/MyScriptUpWorker.sh ubuntu1604rthree@172.18.3.17:~/
sudo ssh-keygen -t rsa -b 4096 -C rke@172.18.3.10
sudo ssh-keygen -t rsa -b 2048 -C rke@172.18.3.10
sudo cat /home/rke/.ssh/id_rsa.pub
sudo cat /home/rke/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
sudo ssh -i $HOME/.ssh/id_rsa rke@172.18.3.10 docker version
ssh-keyscan -p 22 172.18.3.10
ssh-keyscan -p 22 k8s-master
sudo ssh-copy-id -i /home/rke/.ssh/id_rsa master@172.18.3.10
sudo ssh rke@172.18.3.10 -v -i $HOME/.ssh/id_rsa
sudo ssh -i $HOME/.ssh/id_rsa rke@172.18.3.10
eval $(ssh-agent) OR sudo exec ssh-agent bash
ssh-add $HOME/.ssh/id_rsa
echo $SSH_AGENT_SOCK
ssh-add -K -S
ssh-add -X #unlock
ssh-add -l ssh-add -L ssh-add -K ssh-add -D
sudo ssh workertwo@172.18.3.16
.\ssh-keygen.exe -l -f "c:\cert\ssh\my-vsts" -E sha256
ssh -T git@github.com
sudo gedit /etc/ssh/sshd_config
PermitRootLogin yes=>to file :/etc/ssh/sshd_config
#If you have any issues and need to fix permissions issues, run the following comand:
tail -f /var/log/secure
tail -f /var/log/auth.log
restorecon -R -v /root/.ssh