Trusted ssh connection
steps to perform ssh login without password
we will be using
ssh-keygen
ssh-copy-id
you need to create a public and private key in your host
machine
ssh-keygen
now newly created public key must be copied to remote host
which we wan to access
ssh-copy-id
-i <public-key-location> remote-host
Ex:
ssh-copy-id -i .ssh/id_rsa.pub portweb@portaldevfe01
ssh debug
if created ssh secure connection is not working we can use
debug option to find the issue.
#run this on server
sudo /usr/sbin/sshd -d -p 2222
#on client
ssh portweb@portaldevcatalog01 -p 2222
SSH keys with encrypted home directory.......
#do a copy id
ssh-copy-id -i .ssh/id_rsa.pub portweb@10.52.212.107
#copy the authorized file to different location
cp ~/.ssh/authorized_keys /etc/ssh/nuwan/authorized_keys
#change file owner
sudo chown portweb authorized_keys
#set file permission
chmode 640
authorized_keys
#set autorized file location
/etc/ssh/sshd_config
#uncomment and set
AuthorizedKeysFile
/etc/ssh/nuwan/authorized_keys
# Restart sshd
sudo service sshd
restart
ssh portweb@10.52.212.107
trusted ssh connection
certadmin node
.ssh/id_rsa.pub
copy the content to
nightly backend server
.ssh/authorized_key at the bottom
#enforce selinux components disabling
getenforce
#if not Permissive
sudo setenforce 0
to create a trusted conection
ssh-copy-id portaldevcourseadm01
certadmin node
.ssh/id_rsa.pub
copy the content to
nightly backend server
.ssh/authorized_key at the bottom
enforce selinux components disabling
getenforce
if not Permissive
sudo setenforce 0
debug info
ssh -vv root@10.52.208.55
Comments
Post a Comment