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

how to debug ssh login issues on farm #62

Open
ctb opened this issue Jun 25, 2023 · 0 comments
Open

how to debug ssh login issues on farm #62

ctb opened this issue Jun 25, 2023 · 0 comments

Comments

@ctb
Copy link
Member

ctb commented Jun 25, 2023

so! you can't log into farm with ssh because it's asking you for a password and you don't have one! what next??

This is most likely being caused by one of three problems:

  1. your account is not yet created; other than waiting and trying again, and/or confirming with the sysadmin, you can also ask someone who already has an account on the system to look for your account by doing grep -i username /etc/passwd.
  2. your ssh private key is not being found. This may be because it is not named the right thing on your system, or it's in the wrong location.
  3. your ssh public key on the system does not match the private key you are using. This is often because you created the account with the wrong public key, or an old public key is still installed on your farm account.

The steps below will help diagnose

first: add -v to your ssh command line and inspect the output

Instead of doing ssh [email protected] do ssh -v [email protected].

Inspect the output and check that it's finding your private key properly. You're looking for at least one line that says something like:

debug1: Will attempt key: /Users/t/.ssh/id_rsa RSA SHA256:bLtuYpJrIqtClNRSo2dejK+tbMFhkyaNtx5GYWfI2cc
...
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/t/.ssh/id_rsa RSA SHA256:bLtuYpJrIqtClNRSo2dejK+tbMFhkyaNtx5GYWfI2cc

If you continue to have problems logging in, the output of ssh -v is important information to send to the farm helpdesk.

second: try using -v -i <keyfile> to explicitly specify the private key file

If it's not finding the key file above (or even if you think it is), try specifying the key file explicitly:

ssh -v -i /path/to/id_rsa [email protected]

This will (in theory!) make sure that the right key file is being used. (Inspect the output to make sure it IS using it, of course.)

third: regenerate public key & update your account with the (correct) public key

Sometimes your public key on your account may not match the private key you're using to login. There is no way to recover a private key if you've lost track of it, but it's easy to regenerate a public key if you have a private key!

Use the following command to print out a new public key:

ssh-keygen -y -f /path/to/id_rsa

Then, go to https://hippo.ucdavis.edu/Farm/create and paste the output of this command into hippo for the public key.

Note, this will require someone else (the account manager for your lab's buy-in) to approve the hippo request, so it may take a little while.

alternative: generate a new private key

If you've completely lost your private key, or want to just start from scratch (and then update your account as above), do the following to generate a new public/private key pair:

ssh-keygen

Note that if you overwrite your old private key, there is no way to recover it!

appendix: setting up your ssh config

If you put something like this in your ~/.ssh/config file on your laptop/desktop, you can then just type ssh farm to log in.

Host farm
    HostName farm.cse.ucdavis.edu
    User ctbrown
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

1 participant