1️⃣ 파일 압축
- tar
: 여러 파일을 한 컨테이너나 파일에 담아 압축
tar cvf [압축할 파일 이름].tar [경로]
tar xvf [추출할 파일 이름].tar
: 압축되어 있는 파일을 추출해서 해당 경로에 놓고 싶을 때 사용
- gzip
: 압축 사이즈를 더 줄이고 싶을 때 사용
- gzip -d or gunzip
: 기존 사이즈로 돌아가고 싶을 때 사용
2️⃣ FTP (File Transfer Protocol)
서버 a에서 b로 파일을 전송하는 데 사용되는 프로토콜
Port = 21번
3️⃣ 실습
1) 원격 서버에 FTP 설치&구성
* Install and Configure FTP on the remote server
(root)
# rpm -qa | grep ftp
# ping www.google.com
# yum install vsftpd
# vi /etc/vsftpd/vsftpd.conf (make a copy first)
find the following lines and make the changes as shown below.
## Disable anonymous login ##
anonymous_enable=NO
## Uncomment ##
ascii_upload_enable=YES
ascii_download_enable=YES
## Uncomment-Enter Welcome messages-This is optional ##
ftpd_banner=Welcome to UNIXMEN FTP service
## Add at the end of this file ##
use_localtime=YES
# systemctl start vsftpd
# systemctl enable vsftpd
# systemctl stop firewalld
# systemctl disable firewalld
# useradd popoo
2) 클라이언트 서버에 FTP 설치
* Install FTP client on the client server
(root)
# yum install ftp
# su - popoo
$ touch dog.txt
3) FTP 서버에 파일 전송
* Commands to transfer file to the FTP server
ftp 192.168.56.x
Enter username and password
bi
hash
put (file 이름)
bye
4️⃣ SCP (Secure Copy Protocol)
- 로컬 호스트에서 원격 호스트까지 안전하게 파일을 전송하는 것
- FTP에 보안과 인증을 더함
PORT = 22번 (same as SSH)
5️⃣ 실습
1) SCP commands to transfer file to the remote server
Login as yourself _ popoo
# touch (파일 이름)
# scp (파일 이름) popoo@192.168.1.x(client server):/home/popoo
Enter username and password