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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. create_ap: command not found
  2. resize2fs: commnd not found
  3. logger Command Examples in Linux
  4. copyq: Clipboard manager with advanced features
  5. Linux OS Service ‘winbind’
  6. Understanding MySQL Pluggable Authentication
  7. How to enable the automatic extension for a thin LVM volume
  8. Understanding /etc/xinetd.d directory under Linux
  9. CentOS / RHEL 7 : How to configure cache-only nameserver
  10. cppclean: Find unused code in C++ projects

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright