Ssh errors

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Ssh errors
# 1  
Old 01-24-2018
Ssh errors

hello all
Happy New year
I have an issue here whenever I want to ssh into a particular server
I get this error message "Disconnected: NO supported authentication methoids available (server sent publickey)
I was trying to copy the public key to another server so that I do not need nto authenticate against a password and I think something got screwed up
I also ran this command sshd -d for debugging and the output is in this attachment
Please help
Ssh errors-ssh-errorspng
# 2  
Old 01-24-2018
Hi,

Happy New Year to you too ! Firstly, your atetmpt to run sshd at the server-side in debugging mode failed because there was already an instance of sshd listening on port 22, so no new instance could start. To caputre debugging output you'd have to stop the SSH daemon on the server, then run the debugging instance manually again. That would then be able to bind to port 22 and capture debugging info for your incoming session, which might shed more light on things.

Regarding the actual error itself, it would seem to imply that as you suspect something has gone wrong with the key you're trying to use for authentication. Either the key you're using isn't in the authorized_keys file at the server side for the account you're attempting to log in to, or there's something wrong with its entry if it is. Alternatively, there could also be a problem with the permissions on the authorized_keys file, or with the .ssh directory or its parent.

But hopefully actually getting to capture the debugging data will help you figure out what exactly has gone wrong here. You can also get more debugging info from the client side too, by running your SSH command with the -v flag, e.g. ssh -v -v -v user@server.

Hope this helps.

Last edited by drysdalk; 01-24-2018 at 08:32 AM..
# 3  
Old 01-24-2018
Common problems include the files at both sides being world readable. SSH is designed to stop you thinking you are secure but actually credentials could be stolen or adjusted by anyone, e.g. if the authorized_keys can be written by anyone, then they could add their own public key and sign on as that account. If someone can read your private key, then they can access anything you can.

I'm probably over paranoid, but I change the directory ~/.ssh to be mode 700 and the files within to be mode 600. Obviously they must be owned by the correct user.



This might be a quick fix, but it might be totally wrong. Can you show use the output from an ssh -v user@server attempt?



Kind regards,
Robin
# 4  
Old 01-24-2018
thanks
for all your reply
I discovered that my .ssh/authorized_keys is missing
I guess I have to start from scratch to create a public and private key
# 5  
Old 01-24-2018
Hi,

Perhaps - or perhaps not. The authorized_keys file lives at the server end, not the client end. It's used to store your public key, which is generated along with your private key on the client side. So if your keys exist on the client side (typically stored as ~/.ssh/id_rsa.pub and ~/.ssh/id_rsa for RSA keys, for example), then it's just a case of putting the contents of your id_rsa.pub in the .ssh/authorized_keys file underneath the home directory of the target account on the server, and that should be you (as long as the permissions of all the files are correct). But if you have no SSH keys at all on the client side, then yes, you'd need to re-generate everything from scratch.
# 6  
Old 01-24-2018
I have regenerated the ssh key again but still having issues
it does not automatically create a authorized_keys file in the .ssh directory
but has created a id.rsa and id.rsa.pub on the server
What is the next stage
# 7  
Old 01-24-2018
Hi,

Yes, that's right. The authorized_keys file resides at the server-side - that is, on the computer you want to SSH into. The id_rsa private key and associated id_rsa.pub public key reside on the client side - that is, the machine you're going to be SSH'ing from.

So, breaking it down step-by-step, the idea is:
  1. Create your new SSH keys on the client
  2. Copy the contents of the id_rsa.pub file on the client machine into the file ~/.ssh/authorized_keys on the server side
  3. Connect via SSH from the client to the server

So long as the permissions on all files are right, as has previously been discussed, then everything should work. SSH'ing with the key will of course only work for the one specific account that you've added the key to on the server, and not for any others. And likewise, it will only work from the account on the client to which the key belongs, and not any others.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

2. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

3. UNIX for Dummies Questions & Answers

SSH SSH encountered 1 errors during the transfer

This issue was resolved due to using the correct user transferring the file over to the desktop. (1 Reply)
Discussion started by: Computergal2104
1 Replies

4. UNIX for Dummies Questions & Answers

ssh login and auth errors

Hi folks, I'm having some rather odd trouble with ssh. It all started when I tried to create rsa public/private keys to login to a remote ssh account. The account is on a university server and the address redirects to several different machines so (following their wiki instructions...sigh) I... (9 Replies)
Discussion started by: daytripper
9 Replies

5. Solaris

SCP & SSH errors

Hi I am trying to scp a file between to servers (both on same subnet and can see each other). However, whenever I try I get the following error: ld.so.1: ssh: fatal: relocation error: file /usr/local/bin/ssh: symbol EVP_CIPHER_CTX_key_length: referenced symbol not found lost connection I... (4 Replies)
Discussion started by: skewbie
4 Replies

6. UNIX for Advanced & Expert Users

SSH errors

hellow Experts, I want to know that whenever i run ssh command, i get this error > ssh username@x.x.x.x ssh: connect to host x.x.x.x port 22: No route to host or connection refused i want to know the exact reason for these errors .. like because of firewall , no physical conection ,... (3 Replies)
Discussion started by: luckypower
3 Replies

7. UNIX for Dummies Questions & Answers

Major OS errors/Bash errors help!!!!

Hi all, dummy here.... I have major errors on entering the shell. On login I get: -bash: dircolors: command not found -bash: tr: command not found -bash: fgrep: command not found -bash: grep: command not found -bash: grep: command not found -bash: id: command not found -bash: [: =: unary... (12 Replies)
Discussion started by: wcmmlynn
12 Replies

8. AIX

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (2 Replies)
Discussion started by: mcastill66
2 Replies

9. UNIX for Advanced & Expert Users

Adapter Errors and Link Errors

$ errpt | more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION 3074FEB7 0802050205 T H fscsi1 ADAPTER ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR B8113DD1 0802050205 T H fcs1 LINK ERROR 3074FEB7 0802050205 T H fscsi0 ADAPTER ERROR B8113DD1 ... (0 Replies)
Discussion started by: mcastill66
0 Replies
Login or Register to Ask a Question