• 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. CentOS / RHEL 6 : How to Save iptables Rules
  2. lvremove Command Fails With Error “LVM – Can’t remove open logical volume”
  3. passwd: gkr-pam: couldn’t update the login keyring password: no old password was entered
  4. dir Command Examples in Linux
  5. How to modify the iSCSI initiator ID in Linux
  6. How To Separate Each Of Syslog Client’s Messages Into Different File (CentOS/RHEL 6 and 7)
  7. Linux “seq” Command Examples
  8. Unable To Boot Up Linux OS with Auditd (CentOS/RHEL)
  9. How To Calculate The Memory Reserved By HugePages in CentOS/RHEL
  10. How to Replace a Failed Btrfs Device

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright