2017-01-11 13:44:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-24 13:12:16 +02:00
|
|
|
set -x
|
|
|
|
|
2017-01-11 13:44:13 +01:00
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
echo "This script must be run as root" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "Als root Angemeldet"
|
2017-05-24 13:12:16 +02:00
|
|
|
|
2017-01-11 13:44:13 +01:00
|
|
|
apt-get install git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
|
|
|
|
|
2017-01-14 11:02:37 +01:00
|
|
|
pacman -S git openssl autoconf automake make gcc
|
|
|
|
|
2017-01-11 13:44:13 +01:00
|
|
|
cd /opt/
|
|
|
|
|
2017-05-24 13:12:16 +02:00
|
|
|
git clone https://github.com/simono41/shellinabox.git
|
|
|
|
|
|
|
|
cd shellinabox
|
2017-01-11 13:44:13 +01:00
|
|
|
|
|
|
|
autoreconf -i
|
|
|
|
|
|
|
|
./configure && make
|
|
|
|
|
|
|
|
cp shellinabox.service /etc/systemd/system/
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
systemctl enable shellinabox.service
|
|
|
|
|
|
|
|
# adduser
|
|
|
|
|
|
|
|
echo adduser webssh
|
|
|
|
|
|
|
|
useradd webssh
|
|
|
|
|
|
|
|
mkdir /home/webssh
|
|
|
|
|
2017-01-19 16:02:54 +01:00
|
|
|
cp shellinabox_sshwrapper.sh /home/webssh/
|
|
|
|
|
2017-01-14 11:02:37 +01:00
|
|
|
chmod 770 -R /home/webssh/
|
2017-01-11 13:44:13 +01:00
|
|
|
|
2017-01-14 11:02:37 +01:00
|
|
|
chown -cR webssh:webssh /home/webssh/
|
2017-01-11 13:44:13 +01:00
|
|
|
|
2017-01-14 11:02:37 +01:00
|
|
|
passwd webssh <<EOT
|
2017-01-11 13:44:13 +01:00
|
|
|
webssh
|
|
|
|
webssh
|
|
|
|
EOT
|
|
|
|
|
2017-05-24 13:12:16 +02:00
|
|
|
systemctl start shellinabox.service &
|