• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Connect Remote Host Using the ssh Command

by admin

The ssh command allows you to connect to a remote system, or to execute a command on a remote system. The format of the ssh command to connect a remote system is:

# ssh [options] [user@]host [command]

The host argument is the name of the server that you want to connect to, and is the only required argument. For example, to connect to a remote host named host03, enter only the following:

# ssh host03

ssh remote host using a specific user

When you do not specify a user while connecting a remote host using ssh, it attempts to connect to the remote host with the same username that you are logged on as on the local system. You are prompted for only the remote user’s password. To connect to a remote host as a different user, provide the user@ argument:

# ssh root@host03

Execute a command on remote system

To execute a command on a remote system, include the command as an argument. ssh logs you in, executes the command, and then closes the connection, for example:

geeklab# ssh root@192.168.219.149 ls
root@192.168.219.149's password: 
anaconda-ks.cfg
initial-setup-ks.cfg
test
geeklab#

Filed Under: Linux

Some more articles you might also be interested in …

  1. ar – Create, modify, and extract from archives (.a, .so, .o)
  2. How to show line numbers in Gedit
  3. module Command Examples in Linux
  4. cronic: Bash script for wrapping cron jobs to prevent excess email sending
  5. jest Command Examples
  6. engrampa Command Examples in Linux
  7. How to Use the ssh-keygen Command to configure passwordless ssh
  8. findmnt Command Examples in Linux
  9. fstrim Command Examples in Linux
  10. Linux OS Service ‘lm_sensors’

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright