Generating an rsa key to ssh

If you want to set up an an rsa key to ssh into the server without

Generating an SSH key locally on terminal. First you will need to open a terminal.

(base) username@Debbies-MBP-2 ~ % ssh-keygen

Then you will want to copy your RSA code

ssh-copy-id -i ~/.ssh/id_rsa.pub transfer.ccv.brown.edu
ssh-copy-id -i ~/.ssh/id_rsa.pub ssh.ccv.brown.edu

You can validate that this works by ssh-ing in to the server name (or you can specify any name)

ssh transfer.ccv.brown.edu
ssh ssh.ccv.brown.edu

Finally, to see your keys, you can use this command

(base) username@Debbies-MBP-2 ~ % ls ~/.ssh            
authorized_keys	config		id_rsa		id_rsa.pub	known_hosts	known_hosts.old

And here the manual for ssh: https://www.man7.org/linux/man-pages/man5/ssh_config.5.html

Here is info for how to set up Oscar via VSCode: https://ask.cyberinfrastructure.org/t/vscode-remote-ssh-in-oscar/1533/2

Steps:

  1. Download the Remote Development Extension Pack for VS code
  2. Select Remote-SSH:Connect to Host, and enter username@transfer.ccv.brown.edu. To pull up the function, you can press F1.
  3. Once you enter the host, it will autofill a config file for you. You can access this the SSH target from the Remote Explorer button on your VS code. If don’t see SSH Targets” automatically, check the dropdown menu for it.
  4. Voila! Once you press the target, you should be able to type your password (or if you have your RSA key set up it will be set up for you). Then you should be connected to the server.

More tips on ssh from the CCV website: https://docs.ccv.brown.edu/oscar/managing-files/version-control/ssh-agent-forwarding

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s