newtfire / digitProjectDesign-Hub

shared repo for DIGIT 400: Digital Project Design class at Penn State Erie, The Behrend College
Creative Commons Zero v1.0 Universal
12 stars 2 forks source link

Github KeyGen Issues #63

Closed bwm5473 closed 1 year ago

bwm5473 commented 2 years ago

I tried to copy the key to the server, I typed in "$ ssh-copy-id bwm5473@firebelly.newtfire.org -p 3355," but this is the response I got: "/usr/bin/ssh-copy-id: ERROR: Too many arguments. Expecting a target hosame, got: Usage: /usr/bin/ssh-copy-id [-h|-?|-f|-n|-s] [-i [identity_file]] [-p po] [-F alternative ssh_config file] [[-o <ssh -o options>] ...] [user@]honame -f: force mode -- copy keys without trying to check if they are ready installed -n: dry run -- no keys are actually copied -s: use sftp -- use sftp instead of executing remote-commands.an be useful if the remote only allows sftp -h|-?: print this help"

ebeshero commented 2 years ago

@bwm5473 I think we figured this out when I saw you in class, but in case this is an issue for others, here is how we repaired the problem: (It's pinned here in Slack: https://digit-coders.slack.com/archives/C02E5TG1GSK/p1631749245025900 )

ebeshero commented 2 years ago

We can use FileZilla and the seriously insecure password I gave you all to access your space on the server and send up the public key information. You have to save the public key in a text file named authorized_keys , create a .ssh folder in your space on newtfire, and put the authorized_keys file inside .ssh/ (edited)

Details: You set up FileZilla to access newtfire mostly like my instructions on Canvas, but (1) make sure you enter the port number, and (2) set it to “Normal password”. Use the seriously insecure password I gave you for accessing the site. Make sure you can make a connection. FileZilla should take you directly to your individual folder on newtfire. To make the authorized_keys file:

You can use the Git Bash shell to do this. First, find where your computer set the .ssh/ folder. (It is probably at “home” on your computer, as in cd or cd [hit-the-spacebar!!] You will see it among your hidden folders if you use ls -lisa (It is probably up in the top of the results with any folder beginning with a .

Navigate into the .ssh/ directory on your local computer. Now, you can take a look to see what’s inside by entering: ls You should see your two key files. The PUBLIC one is the one we need to copy into an authorized_keys file, and that is the one with the .pub extension. Now, we can do all this in the shell. Let’s make that authorized_keys file: Enter: cp id_rsa.pub authorized_keys

Enter ls to make sure you now have a new authorized_keys file. You can also enter cat authorized_keys to see its content.

Now, you can go back to FileZilla and transfer the authorized_keys file into your space. DO NOT put it in the public_html folder! (Seriously bad: this would be basically PUBLISHING your SSH key in your web space.)

You can use FileZilla’s window on your web space to make a new folder named .ssh on the server. Click to open the .ssh/ folder on the newtfire server.

Then, send over into the newtfire .ssh/ folder the new file you made named authorized_keys that stores the public half of your SSH key. (That is basically completing the work of the ssh-copy-id command.) Once that authorized_keys file is in place, follow the directions in the Canvas assignment to teach FileZilla how to locate the private half of your key.