Files
sci-gui-agent-benchmark/SSH_SERVER_SETUP.md
2023-11-02 11:08:31 +08:00

2.1 KiB

SSH Server Setup Guide

Linux

https://averagelinuxuser.com/ssh-into-virtualbox/

  1. sudo apt install openssh-server
  2. sudo systemctl enable ssh --now
  3. sudo ufw disable (disable firewall - safe for local network, otherwise sudo ufw allow ssh)
  4. ip a - find ip address
  5. ssh username@<ip_address>
  6. On host, run ssh-copy-id <username>@<ip_address>

Windows

To SSH into a Windows machine and control it using the terminal, you need to set up an SSH server on the Windows machine and then connect to it from an SSH client. Microsoft has integrated an OpenSSH server and client in Windows 10 and later, which makes this process more straightforward. Here's how you can do it:

Make sure that your windows account has a password

Setting Up SSH Server on Windows

  1. Enable OpenSSH Server:

    • Open SettingsAppsOptional Features.
    • Scan the list to see if OpenSSH Server is installed. If it's not, click on Add a feature, then find OpenSSH Server, and click Install.
  2. Start the SSH Service:

    • Open Services from the Start menu.
    • Find the OpenSSH SSH Server service, right-click it, and select Properties.
    • Set the startup type to Automatic and then start the service.
  3. Configure the Firewall (if necessary):

    • In most cases, Windows Firewall will automatically allow SSH connections. However, if you have a third-party firewall or if connections are being blocked, you may need to manually open port 22 (default SSH port).
  4. Add ssh key to windows

    • Add the public ssh key to C:\ProgramData\ssh\administrators_authorized_keys and ~/.ssh/authorized_keys

Connecting to the Windows Machine from SSH Client

  1. From a Linux/Mac Client:

    • Open the terminal.
    • Use the command ssh username@windows-ip-address. Replace username with the Windows account username and windows-ip-address with the IP address of the Windows machine.
    • Accept the fingerprint (if it's the first time connecting) and enter the password when prompted.