Hello,
I have created a key pair and able to login without password in devapp01. I am trying to repurpose the same key to ssh to devdb01. I can see the same public key has been copied to both the different systems. But every time I try to ssh to devdb01, it still asks for password.
Note: Just to add, this activity is not to answer any question asked in lab. I am just trying to do out of curiosity if a public key which is used in sever 1 can be used in server 2 as well or not.
bob@devdb01:~$ cd .ssh
bob@devdb01:~/.ssh$ ls
authorized_keys
bob@devdb01:~/.ssh$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTeJ2bGv3SbdHJ8+xwT6rjXuR63PmF2i+cV1LYLwKtF1iO6Uw4CHqwEY5M0Ek/Nzc+0GL+hh4ZUCPRHVnX9ZYCY0on0wOj27PTUdLGVFxslW0b9nradiLXFM2y26BlyO7W6+IdA/2Vdl4uu1PX2I6NAk7IyS4bY4JYiFFh+AeS5lIpXsDfwGNt5i1GA16MGivKQXNdYK30JhA3IaQOIySiw6KUUNB5SQu+CGZsi86gTA0ZiRSDz44DktyiJQ13jqwaWr9C9CUaicY1a+SciKx0yejzfWh0VpLmPUpXkYHqs2k/V2ZaJ51C3x4tsUmNafWmeVEonF17sTo7caAtR/Qd bob@caleston-lp10
bob@devdb01:~/.ssh$ exit
logout
Connection to devdb01 closed.
bob@caleston-lp10:~$ ssh bob@devapp01
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-101-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
_______ _______ _ _______ _______ _________ _______ _
( ____ \( ___ )( \ ( ____ \( ____ \\__ __/( ___ )( ( /|
| ( \/| ( ) || ( | ( \/| ( \/ ) ( | ( ) || \ ( |
| | | (___) || | | (__ | (_____ | | | | | || \ | |
| | | ___ || | | __) (_____ ) | | | | | || (\ \) |
| | | ( ) || | | ( ) | | | | | | || | \ |
| (____/\| ) ( || (____/\| (____/\/\____) | | | | (___) || ) \ |
(_______/|/ \|(_______/(_______/\_______) )_( (_______)|/ )_)
Last login: Sun Aug 9 22:33:36 2020 from 172.16.238.187
bob@devapp01:~$ cd .ssh/
bob@devapp01:~/.ssh$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTeJ2bGv3SbdHJ8+xwT6rjXuR63PmF2i+cV1LYLwKtF1iO6Uw4CHqwEY5M0Ek/Nzc+0GL+hh4ZUCPRHVnX9ZYCY0on0wOj27PTUdLGVFxslW0b9nradiLXFM2y26BlyO7W6+IdA/2Vdl4uu1PX2I6NAk7IyS4bY4JYiFFh+AeS5lIpXsDfwGNt5i1GA16MGivKQXNdYK30JhA3IaQOIySiw6KUUNB5SQu+CGZsi86gTA0ZiRSDz44DktyiJQ13jqwaWr9C9CUaicY1a+SciKx0yejzfWh0VpLmPUpXkYHqs2k/V2ZaJ51C3x4tsUmNafWmeVEonF17sTo7caAtR/Qd bob@caleston-lp10
bob@devapp01:~/.ssh$ exit
logout
Connection to devapp01 closed.
bob@caleston-lp10:~$ ssh bob@devdb01
bob@devdb01's password:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-101-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
_______ _______ _ _______ _______ _________ _______ _
( ____ \( ___ )( \ ( ____ \( ____ \\__ __/( ___ )( ( /|
| ( \/| ( ) || ( | ( \/| ( \/ ) ( | ( ) || \ ( |
| | | (___) || | | (__ | (_____ | | | | | || \ | |
| | | ___ || | | __) (_____ ) | | | | | || (\ \) |
| | | ( ) || | | ( ) | | | | | | || | \ |
| (____/\| ) ( || (____/\| (____/\/\____) | | | | (___) || ) \ |
(_______/|/ \|(_______/(_______/\_______) )_( (_______)|/ )_)
Last login: Sun Aug 9 22:44:08 2020 from 172.16.239.187
bob@devdb01:~$