강의

멘토링

커뮤니티

Inflearn Community Q&A

tjdrnsp1772's profile image
tjdrnsp1772

asked

Understanding AWS Cloud Service Infrastructure Construction, Hacking, and Security

SSH connection using internal server user data

내부서버 사용자데이터를 이용하여 SSH 접속

Written on

·

168

0

cloudformation에서 사용한 yaml 파일 자료를 가지고 ect_private 인스턴스를 생성하고 ec-web에서 ssh root@x.x.x.x로 접속했는데 패스워드가 틀렸다고 출력되고 있습니다.

보안그룹도 ssh 0.0.0.0/0으로 열어둔 상태이며, 사용자 데이터를 아래와 같이 입력하여 인스턴스 생성 후 진행결과, 패스워드가 틀렸다고 하는데 이유를 알 수 있을까요

#!/bin/bash

(

echo "qwe123"

echo "qwe123"

)|passwd --stdin root

sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config

service sshd restart

모의해킹aws

Answer 1

0

ec_private 인스턴스에 직접 접속해서 vi /etc/ssh/sshd_config 파일에서 permitRootLogin prohabit -xxx 을 permitRootLogin yes으로 바꿔보세요

tjdrnsp1772's profile image
tjdrnsp1772

asked

Ask a question