OS : Amazon-Linux


파일질라 설치

https://filezilla-project.org/


1. AWS EC2 Instance에 vsftpd 설치

yum install vsftpd


2. AWS Security Groups 설정

20-21 범위 포트 추가

1024-1048 범위 포트 추가


3. vsftpd.conf 설정

vi /etc/vsftpd/vsftpd.conf


- 익명으로 FTP 접속 금지

anonymous_enable=YES -> anonymous_enable=NO //YES를 NO로 변경


- 사용자의 홈 디렉토리를 제한

chroot_Local_user=YES //(#제거)주석해제


- vsftpd.conf 파일의 마지막부분에

pasv_enable=YES

pasv_min_port=1024

pasv_max_port=1048

pasv_address=IPv4 Public IP


4. FTP 사용자 만들기

cat /etc/vsftpd/user_list 에 없는 사용자를 만들어야 한다.


- 계정생성

useradd test

passwd test


- www 그룹생성

groupadd www

chown -R root:www /var/www/html


- /var/www/html 디렉토리에 대한 권한 부여

usermod -d /var/www/html test //홈 디렉토리 변경

usermod -a -G www test //www 그룹 추가

cd /var/www/html

chmod 775 . //html 디렉토리 775로 권한 부여


5. vsftpd 재시작

service vsftpd restart


6. 파일질라-FTP접속

만들었던 test 계정으로 들어가면 FTP 접속이 된다.


 파일질라-SFTP접속

편집(E) - 설정(S) - SFTP - 키 파일 추가(A) - .ppk파일 추가 - 확인

호스트IPv4 Public IP 사용자명: 계정명 포트: 22 




'개발 > AWS' 카테고리의 다른 글

AWS - 계정 변경 및 Key pair 없이 로그인하기  (0) 2017.04.07

OS : Amazon-Linux


EC2 Instance 생성 후, root 비밀번호는 설정 되어 있지 않음

root계정 로그인 후


1. 계정 생성

adduser test

passwd test


2. ssh key 복사

mkdir /home/test/.ssh

cp /home/ec2-user/.ssh/authorized_keys /home/test/.ssh


3. 소유자, 그룹 소유자 변경

chown -R test:test /home/test/.ssh


4. sshd_config 설정

vi /etc/ssh/sshd_config

.

.

# To disable tunneled clear text passwords, change to no here!

#PasswordAuthentication yes

#PermitEmptyPasswords no

# EC2 uses keys for remote access

PasswordAuthentication no -> PasswordAuthentication yes //no를 yes로 변경

.
.

5. sudo 권한 추가(선택)
vi /etc/

.

.

## Allow root to run any commands anywhere

root    ALL=(ALL)       ALL

test    ALL=(ALL)       ALL //root 계정 밑에 추가하기

.

.


6. sshd 재시작

service sshd restart

'개발 > AWS' 카테고리의 다른 글

AWS - 파일질라 FTP/SFTP 연결하기  (0) 2017.04.09

+ Recent posts