GithubHelp home page GithubHelp logo

00mjk / intheshell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from esin/intheshell

0.0 0.0 0.0 17 KB

Some Go and Linux magic ๐Ÿ‘ป

Home Page: https://in.theshell.xyz

Go 63.15% Shell 2.65% Dockerfile 13.38% HTML 20.82%

intheshell's Introduction

[UPD] 2018-12-01

It's a Docker time :)

Just use command

docker run -d --restart always -p 22:22222 es1n/intheshell

to run latest Docker image, boo! ๐Ÿ‘ป

Don't forget, that image will bind 22 port (ssh), so change your host machine port to something else, 2222 for example

[Deprecated] Installation instruction

Upload intheshell into /usr/local/bin/

Create user ghost

useradd -m -s /usr/local/bin/intheshell ghost

Remove password for ghost

sed -ri s/ghost:(!)?:/ghost:U6aMy0wojraho:/g /etc/shadow

Allow empty password in sshd and add allowed users (file /etc/ssh/sshd_config) and some security changes

..........
PermitEmptyPasswords yes
PasswordAuthentication yes
..........
AllowUsers ghost

### Disable Subsystem
#Subsystem sftp /usr/lib/openssh/sftp-server
### X11 Forwarding
X11Forwarding no

# Adding chroot
Match User ghost
    ChrootDirectory /chroot/ghost
    AllowTcpForwarding no
..........

Adding chroot for user ghost

dir=/chroot/ghost
mkdir -p $dir
mkdir -p $dir/{dev,lib64,lib,bin,etc}
mkdir -p $dir/usr/local/bin
mknod -m 666 $dir/dev/null c 1 3
mknod -m 666 $dir/dev/tty c 5 0
mknod -m 666 $dir/dev/zero c 1 5
mknod -m 666 $dir/dev/random c 1 8
chown root:root $dir
chmod 0755 $dir
mkdir -p $dir/lib/x86_64-linux-gnu/
cp -v /lib/x86_64-linux-gnu/{libncurses.so.5,libtinfo.so.5,libdl.so.2,libc.so.6} $dir/lib/
cp -v /lib64/ld-linux-x86-64.so.2 $dir/lib64/
cat /etc/passwd | grep ghost > $dir/etc/passwd
touch $dir/etc/group
cp -av /bin/stty $dir/bin
cp -av /usr/local/bin/intheshell $dir/bin
cp -av /usr/local/bin/intheshell $dir/usr/local/bin

Disable motd and other stuff on ssh login (not so beautyfull)

chmod -x /etc/update-motd.d/*

Then restart sshd

/etc/init.d/ssh restart

intheshell's People

Contributors

esin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.