Member-only story

SCP shortcut command to known machine

For example you need to deal with different machines, and it takes time to write the IP addresses for each. Can we shorten the writing part?

Donald Le
Dec 30, 2020

What you need to do is list the IP addresses with the corressponding name in /etc/hosts file. For example :

xxx.yy.z.kk master
xxx.yy.z.kk slave1
xxx.yy.z.kk slave2

Then you can do scp with the known host like:

scp dir/etc/dir/file-site.xml slave1:/home/ubuntu/dir/etc/dir

Hope it helps.

PEACE~~

--

--

Donald Le
Donald Le

Written by Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

No responses yet