Debian을 사용하여 FTP를 통해 Google Compute Engine 인스턴스에 액세스할 수 없습니다.

Debian을 사용하여 FTP를 통해 Google Compute Engine 인스턴스에 액세스할 수 없습니다.

Google Compute Engine 인스턴스에서 vsftpd를 설정하려고 시도한 후 FTP 서버에 완전히 연결할 수 없습니다. FileZilla를 사용하여 로그인을 시도한 후 다음 응답을 받습니다.

Status: Connecting to ***.***.***.***:21...
Status: Connection established, waiting for welcome message...
Response:   220 (vsFTPd 2.3.5)
Command:    USER anonymous
Response:   331 Please specify the password.
Command:    PASS **************
Response:   230 Login successful.
Command:    SYST
Response:   215 UNIX Type: L8
Command:    FEAT
Response:   211-Features:
Response:    EPRT
Response:    EPSV
Response:    MDTM
Response:    PASV
Response:    REST STREAM
Response:    SIZE
Response:    TVFS
Response:    UTF8
Response:   211 End
Command:    OPTS UTF8 ON
Response:   200 Always in UTF8 mode.
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/"
Command:    TYPE I
Response:   200 Switching to Binary mode.
Command:    PASV
Error:  Connection timed out
Error:  Failed to retrieve directory listing

이는 vsftpd를 새로 설치한 것임을 참고하세요.

답변1

해결책은 구성 파일에서 PASV 스타일 데이터 연결을 위해 vsftpd가 할당한 포트를 제한하는 것입니다. vsftpd.conf에 다음 두 줄을 추가합니다.

pasv_min_port=12000

pasv_max_port=12100

그런 다음 Google Developers Console의 "네트워크", "방화벽 규칙"에서 해당 포트를 열어야 합니다(그림 참조).

여기에 이미지 설명을 입력하세요.

PASV 명령에 대한 응답으로 vsftpd가 광고하는 IP 주소를 재정의하려면 다음 줄을 추가해야 할 수도 있습니다.

pasv_address=xxx.xxx.xxx.xxx

VM 인스턴스의 외부 IP를 입력합니다.

보안상의 이유로 FTP 포트 21 대신 211도 사용합니다.

수신 포트=211

답변2

Google Computer Engine에는 이미 기본적으로 SFTP 서비스가 있는 것 같습니다. 다음은 WinSCP를 SFTP 클라이언트로 사용하여 서비스에 연결하기 위한 훌륭한 단계별 지침입니다. 처음 시도했을 때 정말 잘 작동했습니다.

http://winscp.net/eng/docs/guide_google_compute_engine

다른 FTP 클라이언트 소프트웨어를 사용할 때도 동일한 원칙이 적용됩니다. 이것이 시간과 노력을 절약해주기를 바랍니다.

관련 정보