Install SCP on CentOS

Por: Dr. Delso Bonfante | June 18, 2013

Install SCP on CentOS

Linux administrator should be familiar with CLI environment. Since GUI mode in Linux servers is not a common to be installed. SSH may the most popular protocol to enable Linux administrator to manage the servers via remote in secure way. Built-in with SSH command there is SCP command. SCP is used to copy file(s) between servers in secure way.

Hello, my name is Diego Luisi and in today’s article will demonstrate how to install and configure the SCP on Linux machine using the CentOS 6.

When is chosen the "minimal" in the installation of CentOS he does not pop things like rsync and SCP.

1. Install Open SSH-Clients:

# yum install openssh-clients -y

2. Copy a file aviso.txt from 192.168.10.1 to 192.168.10.2:

# scp /etc/ssh/aviso.txt root@192.168.10.2:/etc/ssh/

/etc/ssh/aviso.txt => Source File
root@192.168.10.2: => Destination
/etc/ssh/ => Folder destination

If you need to do this procedure on multiple servers at once, I developed a script to automate this task the only thing you’ll need is to create a list of IP addresses of other servers.

#! /bin/bash
# Script Copia de Arquivos 
# Por Diego Luisi
echo "Script para copia de Arquivos"
echo ""
echo "Digite o caminho completo do arquivo de origem: "
read ORIGEM
echo "Digite o caminho de destino do arquivo: "
read DESTINO
echo "Digite o Arquivo que contem os endereços dos servidores: "
read SERVIDORES
cat $SERVIDORES | while read LINHA; do
echo ""
echo $ORIGEM root@$LINHA:$DESTINO
scp $ORIGEM root@$LINHA:$DESTINO
echo ""
echo ""
done

LOREM

dluisi

🚀 Enthusiastic about the DevOps culture and focused on Open Source technologies, I am passionate about automation, with 20 years of experience as a SysAdmin, currently working as an SRE, always open to learning new technologies and procedures to improve every day more as a professional. 👀 I’m interested in Open Source projects (Linux, CNCF, GitOps and Tools) 📚 I’m currently increasing my skills on AWS, K8S, Python, Backstage and some automations tools like Argo (CD, Autopilot, Events, Rollouts and Workflows). 🌱 Goals: Increase my programming skills. 💞 I love old and good Rock and Roll, on weekends traveling on a Harley Davidson.