# Connect to remote CLI devices via PuTTY and Command prompt ## How to connect to remote devices and execute commands using PuTTY and command prompt? CLI access can be tested in two ways: - [Connection and command execution via PuTTY](https://www.manageengine.com/network-monitoring/how-to/cli-connection-via-putty.html#putty-method) - [Connection and command execution via Command Prompt](https://www.manageengine.com/network-monitoring/how-to/cli-connection-via-putty.html#cmd-method) ## Connection and command execution via PuTTY - Launch the PuTTY application on the OpManager server. The PuTTY Configuration window should appear. - In the **Host Name (or IP address)** field, enter the remote machine name. **Note:** The remote machine name will be either the DNS Name or IP Address, depending on the poll-using option set in OpManager. - In the **Connection type** field, choose either **SSH** or **Telnet**. - Based on the connection type, the default port number will be updated in the **Port** field. If the remote machine is configured to use a different port, update the port number accordingly. **Note:** The connection type and port number must match the credential profile associated with the device in OpManager. - Click **Open** to initiate the connection. ![Connect to remote devices and execute commands using Putty and command prompt in OpManager: Putty configuration](https://www.manageengine.com/network-monitoring/how-to/images/cli-1.png) - Once the connection is established, a terminal window will open. - Enter the **username and password** associated with the remote machine in OpManager. - After authentication, the remote machine will be connected via the terminal. ![Connect to remote devices and execute commands using Putty and command prompt in OpManager: Login credentials](https://www.manageengine.com/network-monitoring/how-to/images/cli-2.png) - Once logged in, execute the required **CLI commands**. - The output of the command will be displayed on the terminal. ![Connect to remote devices and execute commands using Putty and command prompt in OpManager: CLI commands](https://www.manageengine.com/network-monitoring/how-to/images/cli-3.png) ## Connection and command execution via Command Prompt - Open the **Command Prompt** on the OpManager-installed server in administrator mode. - Enter the following command to establish a remote connection: ``` connectionType username@deviceName -p portNo ``` - Replace the placeholders as follows: - **connectionType**: Use either **SSH** or **Telnet**. - **username**: The remote machine's username associated with the device in OpManager. - **deviceName**: The remote machine's DNS Name or IP Address, based on the poll-using option set in OpManager. - **portNo**: The port number based on the connection type. The default port for SSH is **22**, and for Telnet, it is **23**. - **Example:** ``` ssh test@devicename -p 22 ``` - Enter the proper **password** and press **Enter**. ![Connect to remote devices and execute commands using Putty and command prompt in OpManager: Connection and command execution via command prompt](https://www.manageengine.com/network-monitoring/how-to/images/cli-4.png) - If the details are correct, the remote machine will be connected via the command prompt. - After a successful login, execute the required **CLI commands**. - The output of the command will be displayed in the command prompt. ![Connect to remote devices and execute commands using Putty and command prompt in OpManager: Connection and command execution via command prompt](https://www.manageengine.com/network-monitoring/how-to/images/cli-5.png) ## Related Products - [Network Monitoring](https://www.manageengine.com/network-monitoring/?relPrd) - [Bandwidth Monitoring & Traffic Analysis](https://www.manageengine.com/products/netflow/?relPrd) - [Network Configuration Management](https://www.manageengine.com/network-configuration-manager/?relPrd) - [Switch Port & IP Address Management](https://www.manageengine.com/products/oputils/?relPrd) - [Firewall Management](https://www.manageengine.com/products/firewall/?relPrd) - [Network Monitoring Software for MSPs](https://www.manageengine.com/network-monitoring-msp/?relPrd) - [IT Operations Management](https://www.manageengine.com/it-operations-management/) - [Application Performance Monitoring](https://www.manageengine.com/products/applications_manager/?relPrd)