Important Linux commands

by Armaghan Saqib, Friday, December 16, 2022, 02:15 (494 days ago)

.

ssh and scp

by Armaghan Saqib, Friday, December 16, 2022, 02:16 (494 days ago) @ Armaghan Saqib

Connecting to servers via ssh:

You can use 'ssh username@server-ip-address-or-hostname' to connect to any linux server. You will be asked for a password to authenticate.

If ssh server on remote server is running on a non-default port (default is 22) then you need to use the following command.

ssh -p 8822 username@server-ip-address-or-hostname

You can also setup your connection using public/private ssh keys so that you do not need to specify a password everything you login.

First generate your ssh keys:

ssh-keygen -t rsa # press return key few times

Copy newly generated public key to the server:

ssh-copy-id username@server-ip-address-or-hostname

For non-standard ssh port (like 8822) use -p as below

ssh-copy-id -p 8822 username@server-ip-address-or-hostname

RSS Feed of thread