scp /local/path/to/file user@remote_server:/remote/path/to/destination
SCP(Secure Copy)는 SFTP(SSH File Transfer Protocol)을 사용하여 SSH 연결을 통해 파일을 안전하게 전송할 수 있는 명령어입니다. 리눅스 서버로 파일 복사하는 SCP 명령은 다음과 같습니다:
```bash
scp /local/path/to/file user@remote_server:/remote/path/to/destination
```
위 명령어는 `/local/path/to/file`을 원하는 로컬 파일, `user@remote_server`은 리눅스 서버의 사용자 이름과 호스트명 연결된 형태, `/remote/path/to/destination`은 리눅스 서버로 보내는 디렉토리 경로를 나타내는 것입니다.
**구체적인 예시:**
1. `my_important_file.txt`라는 파일을 `user@example.com:~/Documents/`로 복사하려고 합니다.
```bash
scp my_important_file.txt user@example.com:/home/user/Documents/
```
2. `/home/user/Documents/`에서 `/home/new_directory/`로 파일을 이동하고 보내는 경우:
```bash
scp /home/user/Documents/my_important_file.txt user@example.com:/home/new_directory/
```
**참고:**
- `scp` 명령은 기본적으로 안전하게 파일을 전송하기 위해 SSH를 사용합니다.
- 서버에 로그인할 수 없는 경우, SSH 키 또는 패키드 암호화를 사용하여 보안을 강화해야 합니다.
- 복사 중 디렉토리가 존재하지 않는 경우 자동으로 생성됩니다.
'꿀팁' 카테고리의 다른 글
중학교 수학 완정 정복 가이드 (4) | 2025.06.14 |
---|---|
Gemini 120% 활용법: AI와 함께 생산성 극대화하는 비밀! (6) | 2025.06.10 |
리눅스 서버 포트 포워딩 (0) | 2025.05.20 |
[꿀팁] 컴퓨터 절전모드 유지하기 (0) | 2021.12.14 |
[꿀팁] Window 10 Home 정품인증 (0) | 2021.08.23 |