Sponsored Content
Full Discussion: ssh login and auth errors
Top Forums UNIX for Dummies Questions & Answers ssh login and auth errors Post 302344266 by System Shock on Saturday 15th of August 2009 12:35:38 PM
Old 08-15-2009
You can remove both entries in known_hosts. They'll get re-populated when you connect to other servers.

There is an obvious error in the third command you typed. You need to put your pub key inside your home directory's ssh folder, and it needs to be in a specific file. If the school's server is using openSSH, you should add your key to ~/.ssh/authorized_keys . If the school's server is using a commercial ssh, then you may have to convert your pub key to their format.

Anyway, let's start from the top. You said that, if you remove all the contents from your .ssh folder, you can ssh to the schools server. So, go ahead and do that, and try to log in and log out the server a couple times just to make sure your login and password work. If you wiped everything off your .ssh directory, you should get a message asking you if you want to accept the server's public key, which should populate .ssh/known_hosts with one entry. While you are there, check to see if you have a .ssh directory inside your home directory, if you don't create one, give it 400 permissions
Code:
$ mkdir .ssh
$ chmod 400 .ssh

After you have established that you can ssh to the server and log in with your username and password, go ahead and create your key. The command below includes the -N flag. If you don't want to supply a passphrase every session, then -N "" will set your passphrase to nothing.
Code:
 ssh-keygen -t rsa -N ""

Now, you'll copy your id_rsa.pub to your home directory in the remote server. Again, assuming the school's server is using openSSH, you'll put your public key in authorized_keys.
Code:
scp ./ssh/id_rsa.pub remote.server.edu:~/.ssh/authorized_keys

Now you should be able to ssh from your computer to the server. If you can't, then we'll need to know the error you received, and take it from there.

About StrictHostKeyChecking=no :
What this does, basically it allows the connection to continue even if you get back the error you posted, that the server pub key and what's in your known_hosts file doesn't match. It is possible that the school server's administrators change the key frequently for whatever reason, and that is why they instruct to add that line to your ssh config. I have that entry in my lab servers, but I don't know that I want to use it in production.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH Problem auth problem

Hi, Just recently we seem to be getting the following error message relating to SSH when we run the UNIX script in background mode: warning: You have no controlling tty. Cannot read confirmation.^M warning: Authentication failed.^M Disconnected; key exchange or algorithm negotiation... (1 Reply)
Discussion started by: budrito
1 Replies

2. HP-UX

X-server errors at login? I want to just get rid of this!

The CDE login manger may repeatedly scroll these error messages on the console: **************************************************************** * The X-server cannot be started on display <hostname>:0... * For details look into the file, Dtlogin.errorLogFile (default: *... (6 Replies)
Discussion started by: emplate
6 Replies

3. 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

4. AIX

SSH + LDAP Auth Giving Fits

I'm having a bear of a time getting my LDAP connection going, so I hope someone here has some insight. I have AIX 5.3 running on an LPAR. I have ldap-client, ldap-max-crypto-client, gskak, and gskte installed. I'm able to set up the connection via mksecldap, and I can query users just fine... (1 Reply)
Discussion started by: AlexDeGruven
1 Replies

5. UNIX for Dummies Questions & Answers

ssh pub key auth - can some please guide me idiot proof

hello. can somebody please idiot proff simple guide me how to set up ssh public key authenciation? i am stuck, i tried long and googled a lot but i cant get it. thanks in advance. (4 Replies)
Discussion started by: scarfake
4 Replies

6. 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

7. AIX

ssh public key auth "Remote login for account is not allowed" ?

Hello, Using AIX 6.1 boxes. User user1 connects from box A to box B using ssh. When password authentication is used everything is fine. When I configure user1 to use public key authentication sftp client works fine(no password asked), but ssh client fails. This is sshd log: Accepted publickey... (3 Replies)
Discussion started by: vilius
3 Replies

8. HP-UX

telnet login successful ,but ssh can not login

why I can login by telnet using root account but when i use login by ssh using root account it is not successful ,is it different password i am sure ssh service is started (2 Replies)
Discussion started by: alert0919
2 Replies

9. 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

10. UNIX for Beginners Questions & Answers

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... (7 Replies)
Discussion started by: DOkuwa
7 Replies
SSH-COPY-ID(1)						      General Commands Manual						    SSH-COPY-ID(1)

NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless you've done some clever use of multiple identities) It also changes the permissions of the remote user's home, ~/.ssh, and ~/.ssh/authorized_keys to remove group writability (which would oth- erwise prevent you from logging in, if the remote sshd has StrictModes set in its configuration). If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file. If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin- gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory, if necessary) SEE ALSO
ssh(1), ssh-agent(1), sshd(8) OpenSSH 14 November 1999 SSH-COPY-ID(1)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy