Connecting to Linux machines with SSH (Linux)

Body

Summary

Connect to a Linux machine from another Linux machine.

Environment

Linux

Directions

  1. Right click on the desktop to bring up the menu. (This is dependent on the desktop environment and does not always work.)
  2. Select Open Terminal. If you don't have this option, find Terminal in the menu.
  3. In the terminal, enter one of the following commands:
    • ssh hostname to connect to the specified hostname with the same username
    • ssh -l username hostname or ssh username@hostname to connect to the specified hostname as the specified user account

 Note: The root user is typically not permitted to log in over ssh. This is best-practice security and should not be casually overridden.

Sometimes, the machine you are trying to connect to may not have a hostname or cannot be resolved by DNS for some reason; but if it has the SSH service running, you can still connect to it by using its IP address. Just substitute the IP address for hostname in the above commands.

You can include the -X option to enable X11 or graphical forwarding, or the -Y option to enable trusted X11 or graphical forwarding, to the left of the [user and] host names. Refer to Running Graphical Software over SSH for more information.

  1. Enter your password when prompted. If you set up public key authentication you can bypass the password prompt

You are now connected to the remote machine. You will see a new prompt with the name of the machine you are connecting to (for example, hostname%).

Details

Details

Article ID: 1707
Created
Wed 5/27/20 10:04 AM
Modified
Tue 12/19/23 2:06 PM