> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crazynode.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting via SSH

> Log in to your CrazyNode VPS securely using SSH and configure key-based authentication.

SSH (Secure Shell) is the standard way to access a Linux VPS. This guide covers first-time login and moving from passwords to SSH keys.

## First login (password)

When your VPS is provisioned, you'll receive an email with:

* Server IP address
* Root password
* SSH port (usually `22`)

### From macOS / Linux

```bash theme={null}
ssh root@YOUR_SERVER_IP
```

Enter your root password when prompted.

### From Windows

Use the built-in OpenSSH client via PowerShell (same command as above), or download [PuTTY](https://www.putty.org).

## Setting up SSH keys (recommended)

SSH keys are far more secure than passwords and don't require typing them each time.

<Steps>
  <Step title="Generate a key pair on your local machine">
    ```bash theme={null}
    ssh-keygen -t ed25519 -C "your_email@example.com"
    ```

    Press Enter to accept defaults. Optionally set a passphrase.
  </Step>

  <Step title="Copy the public key to your VPS">
    ```bash theme={null}
    ssh-copy-id root@YOUR_SERVER_IP
    ```

    Or manually append `~/.ssh/id_ed25519.pub` to `/root/.ssh/authorized_keys` on the server.
  </Step>

  <Step title="Test key-based login">
    ```bash theme={null}
    ssh root@YOUR_SERVER_IP
    ```

    You should log in without a password prompt.
  </Step>

  <Step title="Disable password authentication">
    Edit `/etc/ssh/sshd_config` and set:

    ```text theme={null}
    PasswordAuthentication no
    PermitRootLogin prohibit-password
    ```

    Restart SSH: `systemctl restart sshd`
  </Step>
</Steps>

<Warning>
  Never disable password auth before verifying key login works — you could lock yourself out. If that happens, use the [VNC console](/vps-cloud/managing-vps) to recover.
</Warning>

## Creating a non-root user

Running as root is risky. Create a regular user for daily work:

```bash theme={null}
adduser deploy
usermod -aG sudo deploy
rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy
```

Then SSH in as `deploy@YOUR_SERVER_IP` and use `sudo` for privileged commands.
