SSH -l

SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.

svg viewer

Syntax

The syntax for ssh is:

ssh OPTIONS USERNAME@HOSTNAME
  • OPTIONS(optional): used to specify various command options that can allow authentication, compression, etc.
  • USERNAME(optional): used to specify the username we want to use at the time of connection to the host.
  • HOSTNAME: is the IP address or hostname of the site that we want to connect to.

Using ssh -l

The -l option is used to specify our username and the hostname that we are connecting to. It specifies the user to log in as on the remote machine.

For example, to log in as a user with the username ​root, the command would be:

ssh -l root myexamplewebsite.com

The above command is an alternative to:

ssh root@myexamplewebsite.com

Copyright ©2024 Educative, Inc. All rights reserved