Programing

Filezilla 및 SFTP를 사용하여 Amazon EC2 파일 디렉토리에 연결

lottogame 2020. 3. 12. 08:07
반응형

Filezilla 및 SFTP를 사용하여 Amazon EC2 파일 디렉토리에 연결


AWS EC2 인스턴스를 생성했으며 FileZilla를 사용하여 가장 간단하고 간단한 방식으로 서버 디렉토리에 파일을 업로드 할 수 있기를 원합니다.


이 확인을 위해 비디오 자습서를 만들었습니다.

비디오 자습서, FileZilla 및 SFTP를 사용하여 Amazon EC2 파일 디렉토리에 연결

위의 비디오 자습서 요약 :

  1. (환경 설정)> 설정> 연결> SFTP를 편집하고 "키 파일 추가"를 클릭하십시오.
  2. .pem 파일의 위치를 ​​찾아서 선택하십시오.
  3. 파일을 ppk 형식으로 변환 할 수있는 권한을 묻는 메시지 상자가 나타납니다. 예를 클릭 한 다음 파일 이름을 지정하고 어딘가에 저장하십시오.
  4. 새 파일이 키 파일 목록에 표시되면 다음 단계를 계속하십시오. 그렇지 않으면 "키 파일 추가 ..."를 클릭하고 변환 된 파일을 선택하십시오.
  5. 파일> 사이트 관리자 다음 매개 변수를 사용하여 새 사이트를 추가하십시오.

    Host : 퍼블릭 DNS 이름 EC2 인스턴스 또는 퍼블릭 IP 주소

    프로토콜 : SFTP

    로그온 유형 : 정상

    사용자 : 문서에서 : "Amazon Linux의 경우 기본 사용자 이름은 ec2-user 입니다. RHEL5의 경우 사용자 이름은 종종 루트이지만 ec2-user 일 수 있습니다. Ubuntu의 경우 사용자 이름은 ubuntu 입니다. SUSE Linux의 경우 사용자 이름은 root 입니다. 데비안의 경우 사용자 이름은 admin 입니다. 그렇지 않으면 AMI 제공 업체에 확인하십시오. "

    연결 버튼을 누릅니다-비밀번호 저장이 비활성화 된 경우 로그온 유형이 '비밀번호 요청'으로 변경하라는 메시지가 표시됩니다. '확인'이라고 말하고 연결시 비밀번호 프롬프트에서 비밀번호를 입력하지 않고 '확인'을 눌러 대화 상자를지나갑니다.

    참고 : FileZilla는 사용할 키를 자동으로 알아냅니다. 위에서 설명한대로 키를 가져온 후 키를 지정할 필요가 없습니다.

Cyberduck을 사용하는 경우 다음을 수행 하십시오 .

권한 문제가있는 경우이 게시물을 확인하십시오 .


당신이 당신을 사용하는 경우 이것은 매우 간단합니다 pem file(MacOS / Windows 사용자는 동일한 단계를 수행 할 수 있습니다).

  1. FileZilla를 다운로드하십시오 (MacOS를 사용하고 있으며 무료 버전을 다운로드하면 충분합니다).

  2. FileZilla에서 사이트 관리자 열기 (⌘S)-> 새 사이트

여기에 이미지 설명을 입력하십시오

  1. 호스트 이름을 호스트 필드에 입력하십시오.

예: eca-**-**-**-111.ap-southwest-9.compute.amazonaws.com

  • SFTP로 프로토콜 선택 -SSH 파일 전송 프로토콜

  • 키 파일 로 로그온 유형을 선택하십시오.

  • 사용자 필드 에 사용자 이름을 입력하십시오 : 나에게 그것은 우분투입니다 ( ssh 사용자를 찾으십시오 )

노트 :

OS와 사용자 이름

아마존-EC2 사용자

센 토스-센 토스

데비안-관리자 또는 루트

페도라-EC2-User

RHEL-EC2 사용자 또는 루트

SUSE-ec2-user 또는 root

우분투-우분투 또는 루트

  1. 키 파일 필드에서 pem 파일을 찾아보고 연결을 클릭하십시오.

여기에 이미지 설명을 입력하십시오

  1. 그게 다야 :) 재미있다!

노트 :

(EC2에서 IP 주소로 SSH 연결을 허용해야합니다.) 그렇지 않으면 연결 오류 메시지가 표시됩니다!

참고 : IP가 SFTP를 통해 AWS 인스턴스를 연결하도록 허용

EC2-> 보안 그룹-> SSH-> 인바운드 규칙-> 편집-> 규칙 추가 (SSH | TCP | 22 | 내 IP (IP를 자동으로 가져옵니다 | 규칙 이름)-> 저장


누구든지 모든 단계를 따르고 성공하지 못하면 올바른 사용자를 사용하고 있는지 확인하십시오. "ec2-user"를 사용하려고했지만 "ubuntu"를 사용해야했습니다.


포트 22를 사용하십시오. SFTP의 경우 Filezilla는 기본적으로 포트 21을 사용합니다.


Yasitha Chinthaka의 잘 설명 된 대답에 대한 단 하나의 참고 사항 :

참고 : FileZilla는 사용할 키를 자동으로 알아냅니다. 위에서 설명한대로 키를 가져온 후 키를 지정할 필요가 없습니다.

내 경우에는 이미 과거에 사용했던 다른 인스턴스에서 다른 5 ppks를 가지고 있습니다 (새 인스턴스의 ppk는 해당 목록의 맨 아래에 있음). 새 인스턴스의 새 ppk를 추가했는데 연결할 수 없습니다. 오류 메시지 : 시도 / 시도 횟수가 너무 많습니다.

사용하지 않는 ppks를 삭제 한 후 마침내 인스턴스에 로그인 할 수있었습니다.

Filezilla는 그렇게 똑똑하지 않습니다. ;-)


모든 FTP 클라이언트를 사용할 수 있습니다. 나는 winscp를 사용하고 잘 작동합니다. 이 모든 고객들에게; ssh 보안 키를 지정할 수 있습니다.


FileZilla가 저에게 효과가 없었습니다.이 오류가 계속 발생합니다.

Disconnected: No supported authentication methods available (server sent: publickey)

작동 한 것은 sftp명령이었습니다.

EC2 인스턴스와 연결

sftp -i "path/to/key.pem" ec2-user@ec2-54-212-34-84.us-west-2.compute.amazonaws.com

파일 다운로드 / dirs

다운로드 path/to/source/file.txtpath/to/source/dir:

lcd ~/Desktop
cd path/to/source
get file.txt
get -r dir

파일 업로드

업로드 localpath/to/source/file.txt~/localpath/to/source/dirremotepath/to/dest:

lcd localpath/to/source
cd remotepath/to/dest
put file.txt
put -r dir

Old question but what I've found is that, all you need is to add the ppk file. Settings -> Connections -> SFTP -> Add keyfile User name and the host is same as what you would provide when using putty which is mentioned in http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-connect-to-instance-linux.html Might help someone.


In my case, Filezilla sends the AWS ppk file to every other FTP server I try to securely connect to.

That's crazy. There's a workaround as written below but it's ugly.

It does not behave well as @Lucio M pointed out.

From this discussion: https://forum.filezilla-project.org/viewtopic.php?t=30605

n0lqu:

Agreed. However, given I can't control the operation of the server, is there any way to specify within FileZilla that a site should authenticate with a password rather than key, or vice-versa? Or tell it to try password first, then key only if password fails? It appears to me it's trying key first, and then not getting a chance to try password.

botg(Filezilla admin) replied:

There's no such option.

n0lqu:

Could such an option be added, or are there any good workarounds anyone can recommend? Right now, the only workaround I know is to delete the key from general preferences, add it back only when connecting to the specific site that requires it, then deleting it again when done so it doesn't mess up other sites.

botg:

Right now you could have two FileZilla instances with separate config dirs (e. g. one installed and one portable).

timboskratch:

I just had this same issue today and managed to resolve it by changing the "logon type" of the connection using a password in the site manager. Instead of "Normal" I could select either "Interactive" or "Ask for Password" (not really sure what the difference is) and then when I tried to connect to the site again it gave me a prompt to enter my password and then connected successfully. It's not ideal as it means you have to remember and re-type you password every time you connect, but better than having to install 2 instances of FileZilla. I totally agree that it would be very useful in the Site Manager to have full options of how you would like FileZilla to connect to each site which is set up (whether to use a password, key, etc.) Hope this is helpful! Tim

Also see: https://forum.filezilla-project.org/viewtopic.php?t=34676

So, it seems:

For multiple FTP sites with keys / passwords, use multiple Filezilla installs, OR, use the same ppk key for all servers.

I wish there was a way to tell FileZilla which ppk is for which site in Site Manger


the most simple and straight forward is to create a FTP login. Here is a little and easy to understand tutorial site on stackoverflow itself, how to set things up in 2min... Setting up FTP on Amazon Cloud Server


First of all Filezilla is an FTP/SFTP client/server. We will need to use the client for this purpose.

1) Download the client from the URL: https://filezilla-project.org/

2) Go to AWS management console and then EC2. Select the instance that you want to access and then copy the DNS or IP address of the instance and then paste it in Filezilla host name.

Follow Image: Amazon Instance Access via FileZilla

3) Then, enter the username for the instance that you have created, For Amazon-ami it will be ec2-user and for other OS it would be different. Then, enter the password and port which will be 21 or 22.

4) Then, it will ask for the key, which is in pem format just select the .pem file and then it will confirm authentication. Click on Yes and then you are Done.

Note: In your EC2 Security group allow port number 21 and 22 whichever required for FTP access.


all you have to do is: 1. open site manager on filezilla 2. add new site 3. give host address and port if port is not default port 4. communnication type: SFTP 5. session type key file 6. put username 7. choose key file directory but beware on windows file explorer looks for ppk file as default choose all files on dropdown then choose your pem file and you are good to go.

since you add new site and configured next time when you want to connect just choose your saved site and connect. That is it.


https://www.cloudjojo.com/how-to-connect-ec2-machine-with-ftp/

  1. First you have to install some ftp server on your ec2 machine like vsftpd.
  2. Configure vsftpd config file to allow writes and open ports.
  3. Create user for ftp client.
  4. Connect with ftp client like filezilla.

Make sure you open port 21 on aws security group.

참고 URL : https://stackoverflow.com/questions/16744863/connect-to-amazon-ec2-file-directory-using-filezilla-and-sftp

반응형