Connecting to Linux machines with SSH (Mac)

Tags mac how-to

Objective

Connect to a Linux machine with SSH from a Mac

Environment

Mac

Procedure

  1. In the Finder, navigate to /Applications/Utilities.
  2. Open the Terminal application.
  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%).

Notes

Some prefer to download and use iTerm2 instead, but iTerm2 is not supported by LSA Technology Services.

Details

Article ID: 1845
Created
Wed 5/27/20 11:30 AM
Modified
Thu 10/8/20 4:06 PM