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