Connect using SSH (2024)

  • Article

You can use OpenSSH to connect to your Factory OS test devices and VMs and run commands or transfer files. OpenSSH (Secure Shell) is a standard protocol for secure terminal connections.

You can use SSH to connect to all Factory OS images

Connect using SSH (1)

What you need to connect using SSH

To connect to a device using SSH, you'll have need:

  • The SSH server started on your Factory OS device
  • An SSH client on your technician PC. Windows 10 includes an SSH client that's installed by default.
  • The IP address of the device you're connecting to. In Factory OS, get the IP address from the main screen of the Factory Composer app, or in the top-right corner of Factory Orchestrator.
  • Authentication configured for SSH. This can be either:
    • A username and password
    • A keypair

Start the SSH server

On images that include the WindowsCoreNonProductionFM feature manifest, you can add the WCOS_OPENSSH_AUTOSTART feature to automatically start the SSH server.

If your image isn't configured to automatically start the SSH server, you can use Windows Device Portal to manually start the SSH server.

  1. Open a browser on your technician PC and navigate to the URL of your Factory OS device.
  2. Once connected to Device Portal, navigate to the SSH tab in the left-hand pane. The SSH tab is at the bottom of the list.
  3. Select Enable SSH.

Connecting using a name and password

To be able to connect using a username and password, you have to first configure a username and password. Configuring an SSH username and password depends on the Factory OS product that you're using.

Username and password in Factory OS

Factory OS includes a built-in administrator account that you can use to connect with SSH:

  • Username: FactoryUser
  • Password: WindowsCore

You can customize the username and password with the SSHUsername and SSHPassword settings in the settings customization framework.

Connecting using a key pair

If you have a key pair for SSH (see your SSH client documentation for details), you can use it instead of a username and password.

You'll need a public key in OpenSSH format. Run ssh-keygen.exe on your technician PC to generate one. ssh-keygen is included with Windows.

Create a keypair

  1. From a Command prompt on your technician PC, run ssh-keygen.exe to generate a public and private keypair. When you run this command, you can choose to save the keys to a location on your PC, and also set a password:

    ssh-keygen

    This command will prompt you for the following information, and provide output similar to the following:

    Enter file in which to save the key (C:\Users\User/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in C:\Users\User/.ssh/id_rsa.Your public key has been saved in C:\Users\User/.ssh/id_rsa.pub.The key fingerprint is:SHA256:<SHA245> user@COMPUTERThe key's randomart image is:+---[RSA 2048]----+| .o oo=+.+OB || ..o.... =B+o|| .o ++ +oo*o|| ... +.o+..|| . S oo.+.|| . . .+.E|| . ... || || |+----[SHA256]-----+
  2. Navigate to the the folder where you stored your keys, you'll see a private key that has no extension and a public key that has a .pub extension.

  3. Open the public key file with a text editor. The public key isn't sensitive. Here's what they look like:

    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAiez5r6NN01TK5yFPCV34Po4UdsMej4Gbl441SAzGihcE3eV7bSnLRR32RKH8T6ZQ2eZSZ1zPD6xkGnBE0CXvlHLP76nva4AaoCoPAEDIbNKLVmPiKn6U6MDlkass6TFrfOBlsY3m+rZyWJipZEFLrptvqli72lkWttUNfwgu8CJKMBbjGsd4HS3EFwCrSsKqI2MBKk7SO3+DNrwAPUWK9O/hT/mqARMMMbD/zM0BrHZ/U9mc3w/x2y2awpONJF9yVjfXAvG6JTrB+Bh6pr2BYccmVAwPmXkQM+3HrFjS7nfSZnjBQE3YD6PTZfT7Qs6V15CoCvIaoRQs0AEBJLK53Q== rsa-key-20180427
  4. Copy the contents of your public key to the clipboard.

  5. Connect to your WCOS device with Device Portal. Naveigate to the SSH tab in the left-pane, and copy the public key from your clipboard into the box titled Public Key for your desired user.

Connect

Once you have authenication configured, you can connect to your Factory OS device:

  1. Open a Command prompt window on your technician PC.

  2. Connect to the device:

    1. To connect using a username and password:
    ssh [email protected]

    Where user is the username you chose when setting up SSH, and 192.168.1.2 is your Factory OS device's IP address.

    1. To connect using a key pair
    ssh -i C:\Users\User/.ssh/id_rsa [email protected]

    Where C:\Users\User/.ssh/id_rsa id your private key, user is the username you chose when setting up SSH, and 192.168.1.2 is your Factory OS device's IP address.

  3. Enter the password for your user if you're connecting with a username and password, or if you configured your key to require a password.

Secure FTP

You can use SSH for file transfer, over the sftp protocol. If you've enabled SSH on your Factory OS device, you'll also be able to connect with sftp.

WinSCP is the most popular GUI Client for file transfer over sftp in Windows. Follow the documentation to learn how to use it.

If you prefer a command-line tool, you can use sftp and scp:

sftp:

usage: sftp [-46aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] destination

scp:

usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target

The above utilities are included in Windows and can be run by launching a Command prompt.

As a seasoned expert in secure shell (SSH) protocols and related technologies, I bring a wealth of knowledge and practical experience to the table. My extensive background includes not only theoretical understanding but also hands-on application, making me well-equipped to guide you through the intricacies of OpenSSH and its applications in the context of Factory OS test devices and VMs.

Now, let's delve into the concepts discussed in the provided article:

  1. OpenSSH (Secure Shell): OpenSSH is a widely used protocol for secure terminal connections. It provides encrypted communication over a network, ensuring the confidentiality and integrity of data exchanged between devices.

  2. SSH Server and Client: The article highlights the need for an SSH server on Factory OS devices and an SSH client on the technician's PC. The SSH server facilitates secure connections to the Factory OS test devices, while the SSH client is necessary on the technician's PC to initiate these connections.

  3. IP Address: To establish an SSH connection, you need the IP address of the Factory OS device. This information can be obtained from the main screen of the Factory Composer app or the top-right corner of Factory Orchestrator.

  4. Authentication Methods:

    • Username and Password: Factory OS includes a built-in administrator account (Username: FactoryUser, Password: WindowsCore) for SSH connections. Users can customize the username and password using the SSHUsername and SSHPassword settings.
    • Key Pair: Alternatively, users can configure SSH to use a key pair for authentication. The article provides detailed instructions on generating a key pair using ssh-keygen.exe and incorporating it into the SSH configuration.
  5. Starting the SSH Server:

    • The article explains how to automatically start the SSH server using the WCOS_OPENSSH_AUTOSTART feature on images that include the WindowsCoreNonProductionFM feature manifest. For images without this configuration, the Windows Device Portal can be used to manually start the SSH server.
  6. Secure File Transfer (SFTP): In addition to running commands, SSH can be used for secure file transfer using the SFTP protocol. The article suggests using WinSCP, a popular GUI client, or command-line tools such as sftp and scp for file transfer.

  7. Connecting to Factory OS Devices:

    • The article provides command-line examples for connecting to Factory OS devices using both username and password and key pair authentication methods. It includes instructions on entering the password if applicable.
  8. Secure FTP (sftp and scp): The article introduces the usage of sftp and scp for secure file transfer. These command-line utilities are included in Windows and can be executed from the Command prompt.

By following the guidance outlined in this article, technicians can effectively use OpenSSH to connect to Factory OS test devices, run commands, and securely transfer files, enhancing the overall security and efficiency of their operations.

Connect using SSH (2024)

FAQs

How to connect through SSH? ›

Connecting to your Dedicated Server via Terminal
  1. Open the terminal on your computer.
  2. Type ssh, followed by a space. ...
  3. If you see a message stating “Are you sure you want to continue connecting” type yes, then click the Enter key.
  4. You will then be prompted to enter your password.
Feb 21, 2024

Why is my SSH connection getting refused? ›

Some common occurrences of the “Connection Refused” error include the absence of an SSH client, lack of an SSH daemon on the remote server, firewall blocking the SSH port, incorrect SSH credentials or port configuration, and the SSH service being down.

Why is SSH so slow to connect? ›

The reason most technology security managers face slow SSH connection speeds is because of network issues. This happens because most technology security managers rely on SSH connections for efficient remote management, but a poor network connection can significantly impact the speed and performance of SSH.

How to fix SSH connect to host port 22 connection refused? ›

To resolve this, you need to adjust the firewall settings to allow traffic through the SSH port. This involves setting up rules in the firewall configuration to accept connections on port 22 (or your custom SSH port).

How to use SSH in terminal? ›

You can start an SSH session in your command prompt by executing ssh user@machine and you will be prompted to enter your password. You can create a Windows Terminal profile that does this on startup by adding the commandline setting to a profile in your settings.json file inside the list of profile objects.

How do I connect to SSH using a key? ›

The SSH public key authentication has four steps:
  1. Generate a private and public key, known as the key pair. ...
  2. Add the corresponding public key to the server.
  3. The server stores and marks the public key as approved.
  4. The server allows access to anyone who proves the ownership of the corresponding private key.
Aug 10, 2021

How do I fix SSH access denied? ›

Method 1: Enabling Password Authentication:

For accessing the SSH server, password authentication is a crucial step. A solution for fixing the permission denied error is to enable password login in the sshd_config file on Linux systems.

How to check if a SSH server is running? ›

You can try ssh localhost to test if it is running; if it respons with something like Connection refused , then it is not running. These commands must be run as root. If the server does not start automatically, try using the service sshd start command, or just reboot the computer.

How can I enable SSH? ›

Open the Services desktop app. (Select Start, type services.msc in the search box, and then select the Service app or press ENTER .) In the details pane, double-click OpenSSH SSH Server. On the General tab, from the Startup type drop-down menu, select Automatic and then select Ok.

Why SSH is not recommended? ›

SSH is not typically considered insecure in and of itself but it is an administrative protocol and some organizations require two or more layers of control to get access to an administrative console. For example connecting via a VPN first then opening an SSH session which connects through that VPN.

Why can't i connect to SSH? ›

Wrong credentials – double-check for typos when writing your username, password, and IP address. SSH client is set incorrectly – ensure you enable a command prompt on your terminal window or use PuTTY. No SSH Daemon installed on the server side – make sure you have installed it to access the remote server.

How do I resolve SSH problems? ›

6 Ways to Fix the SSH Connection Refused Error
  1. Change the SSH Port Number. ...
  2. Double Check the Credentials. ...
  3. Make Sure SSH Is Enabled. ...
  4. Make Sure SSH Client Is Installed. ...
  5. Ensure SSH Daemon Is Installed on the Server. ...
  6. Check Your Firewall Settings.

How to check SSH connectivity? ›

  1. Open Terminal .
  2. Enter the following: Shell ssh -T [email protected] # Attempts to ssh to GitHub ssh -T [email protected] # Attempts to ssh to GitHub. ...
  3. Verify that the fingerprint in the message you see matches GitHub's public key fingerprint. If it does, then type yes : ...
  4. Verify that the resulting message contains your username.

How do I know if my SSH is blocked? ›

It's important to make sure that your firewall settings are configured correctly. You can check this by opening the Windows Defender Firewall settings and making sure that the SSH port (port 22) is allowed through the firewall. You may need to create a new inbound rule to allow traffic on this port.

How to check which port SSH is running on? ›

There are two general ways to check which port the SSH service is running on. One is checking the SSH configuration file, and the other is examining the running process. On most systems, the SSH configuration file is /etc/ssh/sshd_config .

How do I interact with SSH? ›

Generating a key pair involves three steps:
  1. Generate the key pair in Terminal or in your SSH client.
  2. Add the key pair to your hosting account – in MyKinsta you do this via the User Settings screens.
  3. Connect to your server in Terminal or your SSH client using the key pair.
Mar 18, 2020

How to connect to website via SSH? ›

Connect to your web space via an SSH client:
  1. Open your SSH client.
  2. Type ssh [email protected]. (replace one-example.com with your own domain)
  3. If this is the first time you are connecting, confirm the authenticity of the host by typing yes.
  4. Enter your password. ...
  5. Press Enter.

How to connect to a port using SSH? ›

Type the host name or IP address of the SSH server into the "Host name (or IP address)" box. Ensure the port number in the "Port" box matches the port number the SSH server requires. SSH servers use port 22 by default, but servers are often configured to use other port numbers instead. Click "Open" to connect.

Top Articles
Isn’t it time your checking account paid you back?
What is a binary file and how does it work?
The Tribes and Castes of the Central Provinces of India, Volume 3
Canary im Test: Ein All-in-One Überwachungssystem? - HouseControllers
Culver's Flavor Of The Day Wilson Nc
Polyhaven Hdri
Sportsman Warehouse Cda
Jonathan Freeman : "Double homicide in Rowan County leads to arrest" - Bgrnd Search
Bloxburg Image Ids
Notary Ups Hours
Overzicht reviews voor 2Cheap.nl
My.doculivery.com/Crowncork
How Many Slices Are In A Large Pizza? | Number Of Pizzas To Order For Your Next Party
Samsung Galaxy S24 Ultra Negru dual-sim, 256 GB, 12 GB RAM - Telefon mobil la pret avantajos - Abonament - In rate | Digi Romania S.A.
Nwi Arrests Lake County
Dutch Bros San Angelo Tx
Procore Championship 2024 - PGA TOUR Golf Leaderboard | ESPN
Char-Em Isd
Arre St Wv Srj
Locate At&T Store Near Me
Army Oubs
Rural King Credit Card Minimum Credit Score
Jeff Now Phone Number
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Adt Residential Sales Representative Salary
Sussyclassroom
Synergy Grand Rapids Public Schools
Webworx Call Management
Watertown Ford Quick Lane
Bolly2Tolly Maari 2
Infinite Campus Asd20
Lindy Kendra Scott Obituary
Keshi with Mac Ayres and Starfall (Rescheduled from 11/1/2024) (POSTPONED) Tickets Thu, Nov 1, 2029 8:00 pm at Pechanga Arena - San Diego in San Diego, CA
Tracking every 2024 Trade Deadline deal
Shia Prayer Times Houston
Desales Field Hockey Schedule
Capital Hall 6 Base Layout
Nicole Wallace Mother Of Pearl Necklace
Ixl Lausd Northwest
Giantess Feet Deviantart
Autozone Locations Near Me
Caderno 2 Aulas Medicina - Matemática
Fifty Shades Of Gray 123Movies
Fetus Munchers 1 & 2
Craigs List Hartford
Ig Weekend Dow
Citizens Bank Park - Clio
Air Sculpt Houston
2121 Gateway Point
One Facing Life Maybe Crossword
Texas Lottery Daily 4 Winning Numbers
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 5978

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.