Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

avatar

I am installing single node cluster but I am getting the Permission denied (publickey,gssapi-keyex,gssapi-with-mic) .

however I have set

PasswordAuthentication yes
PermitRootLogin yes 
in the /etc/ssh/sshd_config 
service sshd restart

i have done below steps from root :

selinux=disabled
service iptables stop
service ip6tables stop
chkconfig iptables off 
chkconfig ip6tables off 
service ntpd start
chkconfig ntpd on
ssh-keygen -t rsa
cd .sshcat id_rsa >> authorized_keys
chmod 700 ~/.ssh

when i try to

[root@instance-5 .ssh]# ssh host
[email protected]'s password:

but earlier trying the same root password on the same host required .

Thanks

Anurag

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Anurag Mishra

I guess the command the following command was incorrectyou are storing Private key instead of Public key file.

# cd .ssh
# cat id_rsa >> authorized_keys

.

You should be passing the "id_rsa.pub" file instead like following

# cd .ssh
# cat id_rsa.pub >> authorized_keys
(OR)
# ssh-copy-id  -i ~/.ssh/id_rsa.pub  $HOST

.

Additionally can you please verify if the "hostname" which you are passing to the SSH command is correct? Please run the following command to verify the hostname.

# hostname
# hostname -f

.

Then after verifying the hostname please run the below command.

# ssh-copy-id  -i ~/.ssh/id_rsa.pub  $HOST

.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@Anurag Mishra

I guess the command the following command was incorrectyou are storing Private key instead of Public key file.

# cd .ssh
# cat id_rsa >> authorized_keys

.

You should be passing the "id_rsa.pub" file instead like following

# cd .ssh
# cat id_rsa.pub >> authorized_keys
(OR)
# ssh-copy-id  -i ~/.ssh/id_rsa.pub  $HOST

.

Additionally can you please verify if the "hostname" which you are passing to the SSH command is correct? Please run the following command to verify the hostname.

# hostname
# hostname -f

.

Then after verifying the hostname please run the below command.

# ssh-copy-id  -i ~/.ssh/id_rsa.pub  $HOST

.