Shell In A Box - 웹 브라우저를 통해 Linux SSH 터미널에 액세스
Shell In A Box(shellinabox로 발음)는 Markus Gutschke가 만든 웹 기반 터미널 에뮬레이터입니다. 지정된 포트에서 웹 기반 SSH 클라이언트로 실행되고 액세스 및 제어를 위해 웹 터미널 에뮬레이터를 묻는 웹 서버가 내장되어 있습니다. >Linux 서버 SSH 셸은 다음과 같은 추가 브라우저 플러그인 없이 AJAX/JavaScript 및 CSS 지원 브라우저를 원격으로 사용합니다. FireSSH로.
이 튜토리얼에서는 모든 컴퓨터에서 최신 웹 브라우저를 사용하여 Shellinabox를 설치하고 원격 SSH 터미널에 액세스하는 방법을 설명합니다. Linux 서버에 대한 웹 기반 SSH 액세스는 방화벽으로 보호되고 HTTPS 트래픽만 통과할 수 있는 경우 매우 유용합니다.
Linux 시스템에 Shellinabox 설치
기본적으로 Shellinabox 도구는 표시된 대로 기본 패키지 관리자를 사용하는 기본 저장소를 통해 Debian 기반 Linux 배포판에 포함되어 있습니다.
Debian, Ubuntu 및 Mint에 Shellinabox 설치
sudo apt install openssl shellinabox
RHEL, Fedora, Rocky 및 AlamLinux에 Shellinabox 설치
Red Hat 기반 배포판에서는 다음 명령을 사용하여 소스에서 설치해야 합니다.
yum install git openssl-devel pam-devel zlib-devel autoconf automake libtool
git clone https://github.com/shellinabox/shellinabox.git && cd shellinabox
autoreconf -i
./configure && make
Linux 시스템에서 Shellinabox 구성
기본적으로 shellinaboxd는 localhost의 TCP 포트 4200를 수신합니다. 보안상의 이유로 이 기본 포트를 임의(예: 6175)로 변경하여 누구든지 SSH 상자에 접근하기 어렵게 만듭니다.
또한 설치 중에 HTTPS 프로토콜을 사용하기 위해 새로운 자체 서명 SSL 인증서가 "/var/lib/shellinabox" 아래에 자동으로 생성됩니다.
sudo vi /etc/default/shellinabox
OR
sudo nano /etc/default/shellinabox
아래와 같이 구성을 변경합니다…
Should shellinaboxd start automatically
SHELLINABOX_DAEMON_START=1
TCP port that shellinboxd's webserver listens on
SHELLINABOX_PORT=6175
Parameters that are managed by the system and usually should not need
changing:
SHELLINABOX_DATADIR=/var/lib/shellinabox
SHELLINABOX_USER=shellinabox
SHELLINABOX_GROUP=shellinabox
Any optional arguments (e.g. extra service definitions). Make sure
that that argument is quoted.
#
Beeps are disabled because of reports of the VLC plugin crashing
Firefox on Linux/x86_64.
SHELLINABOX_ARGS="--no-beep"
specify the IP address of an SSH server
OPTS="-s /:SSH:192.168.0.140"
if you want to restrict access to shellinaboxd from localhost only
OPTS="-s /:SSH:192.168.0.140 --localhost-only"
구성이 완료되면 다음 명령을 실행하여 shellinabox 서비스를 다시 시작하고 확인할 수 있습니다.
sudo systemctl restart shellinabox
sudo systemctl status shellinabox
이제 netstat 명령을 사용하여 Shellinabox가 포트 6175에서 실행되고 있는지 확인해 보겠습니다.
sudo netstat -nap | grep shellinabox
방화벽에서 shellinabox를 보호하고 특정 IP 주소에 대한 6175 포트를 열어서 액세스하세요. 원격으로 Linux 쉘.
------- On Debian, Ubuntu and Mint -------
sudo ufw allow 6175/tcp
sudo ufw allow from 192.168.0.103 to any port 6175
------- On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux -------
sudo firewall-cmd --zone=public --add-port=6175/tcp
sudo firewall-cmd --zone=public --add-source=192.168.0.103/6175 --permanent
웹 브라우저를 통해 Linux SSH 터미널에 액세스
이제 웹 브라우저를 열고 https://Your-IP-Adress:6175로 이동하세요. 웹 기반 SSH 터미널을 볼 수 있어야 합니다. 사용자 이름과 비밀번호를 사용하여 로그인하면 쉘 프롬프트가 표시됩니다.
마우스 오른쪽 버튼을 클릭하여 셸의 모양과 느낌 변경을 포함한 여러 기능과 작업을 사용할 수 있습니다.
자세한 내용은 공식 Shellinabox github 페이지를 방문하세요.