SSH Passwordless Authentication Setup for ai-panther.fit.edu

Overview

This guide sets up SSH key-based authentication for passwordless login to ai-panther.fit.edu. Instructions are provided for both Windows (PowerShell) and Linux/macOS.

Windows (PowerShell)

1. Generate an SSH Key

ssh-keygen -t ed25519 -f $env:USERPROFILE\.ssh\id_ed25519

Press Enter when prompted for a passphrase (or set one for extra security).

2. Copy the Public Key to the Server

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh user2020@ai-panther.fit.edu "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Enter your password when prompted. This will be the last time it is required.

3. Configure SSH

@"
Host ai-panther
    HostName ai-panther.fit.edu
    User user2020
    IdentityFile ~/.ssh/id_ed25519
"@ | Set-Content $env:USERPROFILE\.ssh\config

4. Test the Connection

ssh ai-panther

You should connect without being prompted for a password.


Linux / macOS

1. Generate an SSH Key

ssh-keygen -t ed25519

Press Enter when prompted for a passphrase (or set one for extra security).

2. Copy the Public Key to the Server

ssh-copy-id user2020@ai-panther.fit.edu

Enter your password when prompted. This will be the last time it is required.

3. Configure SSH

cat << 'EOF' > ~/.ssh/config
Host ai-panther
    HostName ai-panther.fit.edu
    User user2020
    IdentityFile ~/.ssh/id_ed25519
EOF
chmod 600 ~/.ssh/config

4. Test the Connection

ssh ai-panther

You should connect without being prompted for a password.


VS Code Remote-SSH

Once the above steps are complete, VS Code will automatically use the SSH config. In VS Code:

  1. Install the Remote - SSH extension.
  2. Open the Command Palette (Ctrl+Shift+P) and select Remote-SSH: Connect to Host...
  3. Select ai-panther from the list.

Troubleshooting

  • Permission denied after setup: Verify permissions on the server:
  chmod 700 ~/.ssh
  chmod 600 ~/.ssh/authorized_keys
  • Wrong key being used: Explicitly specify the key when connecting:
  ssh -i ~/.ssh/id_ed25519 user2020@ai-panther.fit.edu
  • Existing SSH config: If you already have an SSH config file, append the Host ai-panther block instead of overwriting the file.