Multipass + SSH + 텍스트 파일 쓰기

ujinsim·2025년 4월 3일
1
post-thumbnail

Multipass를 이용한 Ubuntu 가상 머신 생성, SSH 설정, 텍스트 파일 작성 및 SSH 접속 확인 과정까지의 명령어 정리


1. Multipass VM 생성 및 접속

multipass launch --name selected-neanderthal
multipass shell selected-neanderthal

2. VM 안에서 SSH 서버 설치 및 설정

sudo apt update
sudo apt install openssh-server

sudo systemctl enable ssh
sudo systemctl start ssh

3. 비밀번호 인증 허용

sudo passwd ubuntu

비밀번호 입력 후:

sudo nano /etc/ssh/sshd_config.d/60-cloudimg-settings.conf

PasswordAuthentication yes 추가 또는 수정

sudo systemctl restart ssh

4. 맥북에서 SSH 접속

ssh ubuntu@192.168.64.9

cat /etc/ssh/sshd_config | grep Port
// 포트번호 확인용 명령어 

5. 텍스트 파일 작성 (VM 안에서)

echo "안녕하세요, 이건 테스트입니다." > hello.txt
cat hello.txt

6. SSH 세션 종료

exit

  • Multipass VM 생성
  • SSH 서버 실행 및 비밀번호 설정
  • 비밀번호 인증 허용 (PasswordAuthentication yes)
  • 맥북에서 SSH 접속 성공
  • 텍스트 파일 작성 및 확인
profile
프론트엔드 공부 중인 학생입니다. 💻👩‍🎤

0개의 댓글