Skip to content

Instantly share code, notes, and snippets.

@fahimbabarpatel
Last active August 13, 2016 17:58
Show Gist options
  • Save fahimbabarpatel/3812bed277846154d72a75336d057274 to your computer and use it in GitHub Desktop.
Save fahimbabarpatel/3812bed277846154d72a75336d057274 to your computer and use it in GitHub Desktop.
ssh_special_commands
ssh remote_host

The remote_host in this example is the IP address or domain name that you are trying to connect to.

This command assumes that your username on the remote system is the same as your username on your local system.

If your username is different on the remote system, you can specify it by using this syntax:


ssh remote_username@remote_host

You can copy the public key to the remote server by issuing this command:

ssh-copy-id remote_host

If you only wish to execute a single command on a remote system, you can specify it after the host like so:

ssh remote_host command_to_run

As we said before, if X11 forwarding is enabled on both computers, you can access that functionality by typing:

ssh -X remote_host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment