AWS

AWS EC2 SSH pem키 없이 접속하기

Choiji 2021. 5. 11. 22:40

ec2-user 비밀번호 설정


$ sudo passwd ec2-user
Changing password for user ec2-user.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

 

sshd_config 수정


$ sudo vi /etc/ssh/sshd_config
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no
#PasswordAuthentication no
  1. vi 에디터에서 insert키를 누르고 입력 모드로 변경한 후
  2. PasswordAuthentication yes 주석 해제
  3. PasswordAuthentication no 주석 처리
  4. esc -> :wq로 저장 후 종료

 

SSH 서비스 재시작


$ sudo service sshd restart
Redirecting to /bin/systemctl restart sshd.service

 

Putty를 재시작 하시고 인증키 없이 접속해보시면 비밀번호를 입력하라고 하는데 입력하고 사용하시면 됩니다.

login as: ec2-user
ec2-user@?.??.???.???'s password:

'AWS' 카테고리의 다른 글

AWS(아마존 웹 서비스) ssh로 인스턴스에 연결  (0) 2021.05.11
AWS 인스턴스  (0) 2021.05.08