지식 공유

스마트폰을 리눅스 서버로 만들기 (루팅x, 안드로이드, termux)

한상규 2020. 6. 30. 13:48

termux라는 안드로이드 위에서 동작하는 리눅스 에뮬레이터가 있다. 가상머신이라고 생각하면 쉽겠다.

 

https://play.google.com/store/apps/details?id=com.termux

 

Termux - Google Play 앱

Termux combines powerful terminal emulation with an extensive Linux package collection. • Enjoy the bash and zsh shells. • Edit files with nano and vim. • Access servers over ssh. • Develop in C with clang, make and gdb. • Use the python console

play.google.com

 

구글 플레이스토어에서 쉽게 다운로드 받을 수 있다.

 

$ pkg update 
$ pkg upgrade

일단 pkg를 업데이트, 업그레이드 해준다. 

 

$ pkg install openssh

ssh를 설치한다.

 

 

$ which sshd

sshd가 설치됐는지 확인하기

 

 

$ sshd

ssh를 백그라운드로 실행한다.

 

$ ifconfig

스마트폰의 IP를 알아낸다.(ipconfig아님)

 

$ whoami
u0_a175 

$ passwd 
New password: 
Retype new password: 
New password was successfully set.

유저 이름을 알아내고 비밀번호를 설정해준다.

 

 

 

포트번호는 ssh 기본포트인 22가 아니 8022이다.

 

ssh -p 8022 u0_a175@192.168.0.23

 

putty나 git bash같은 ssh 클라이언트 프로그램으로 접속을 한다.

 

 

+추가내용

ssh 통신이 지속되지 않으면 packet_write_wait: Connection to XXX.XX.XX.XXX: Broken pipe 에러가 발생해서 연결이 끊어진다. 

 

 

그래서 Mosh를 사용해보자

$ pkg install mosh

서버에 mosh 설치하기

 

 

$ mosh-server

mosh 실행

 

 

 

mosh 클라이언트가 있어야 함

크롬확장프로그램에 좋은 것이 있음

mobaXterm도 좋음

https://chrome.google.com/webstore/detail/mosh/ooiklbnjmhbcgemelgfhaeaocllobloj/related

 

Mosh

Mosh (mobile shell) for Chrome

chrome.google.com

https://mobaxterm.mobatek.net/

 

MobaXterm free Xserver and tabbed SSH client for Windows

The ultimate toolbox for remote computing - includes X server, enhanced SSH client and much more!

mobaxterm.mobatek.net