Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing Issue in Configuring SSH Access #783

Open
akshat-kumar2109 opened this issue May 17, 2024 · 1 comment
Open

Facing Issue in Configuring SSH Access #783

akshat-kumar2109 opened this issue May 17, 2024 · 1 comment

Comments

@akshat-kumar2109
Copy link

akshat-kumar2109 commented May 17, 2024

I had to manually add the SSH keys to each servers. I am getting this error on the following command. Can anyone tell me what can be the reason for this?

root@ip-172-31-19-252:~/kubernetes-the-hard-way# while read IP FQDN HOST SUBNET; do    ssh-copy-id root@${IP}; done < machines.txt
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@34.232.210.182: Permission denied (publickey).
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@3.221.163.8: Permission denied (publickey).
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@3.238.13.255: Permission denied (publickey).

@aasourav
Copy link

aasourav commented May 21, 2024

this works on my local virtual machines. didn't try on cloud.

step 1:
sudo vim /etc/ssh/sshd_config
step 2:
FROM:
#PermitRootLogin prohibit-password
TO:
PermitRootLogin yes

Shortcut (Step 1 + Step 2):
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

step 3:
sudo systemctl restart ssh

step 4:
sudo passwd
[sudo] password for linuxconfig:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

step 5:
sudo ufw allow ssh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants