MV.net: | inicio / home | documentos / documents | software / software | personal / personal | blog |
Software: | inicio / home | CMS4P | IEEditor | mvDocRun | OSCPMWin | OSCPM-Aspel | phpWPoison | phpSETIMon | SiTeFiLo | SleepShell |
This is a simple do-nothing, sleep-forever program that can be used as a login shell (in Linux or Unix) to keep the connection open but without interactive shell. We use it to create SSH accounts for users who will only use them for SSH-tunneling; to create an encrypted tunnel to our servers (for example to connect securely to database servers like mySQL, PostgreSQL, etc).
Most restricted shells still allow execution of local commands from the SSH account. Setting the account shell to something like /bin/false (or any other simple programs) usually won't work because the tunnel is closed as soon as the program finish its execution. Sleep Dummy Shell just sleeps until its execution is terminated by the user or the tunnel is closed.
The Sleep Dummy Shell is the perfect solution for extranet, intranet and public hosting providers who wish to provide their customers with SSH accounts for encripted tunneling, without worrying about extra security.
Features.
Requirements.
Installation.1) Get the files. 2) Unpack. tar tvzf sleepshell_0.0.2.tar.gz
3) Compile. gcc -O2 -g sleepshell.c -o sleepshell
After this, a new executable file named "sleepshell" should be in the directory. 4) Test. Connection: 192.168.0.25 2640 192.168.0.1 22
Or just (one asterisk per 10-seconds): ***
5) Install. cp sleepshell /usr/local/bin/sleepshell
6) Set as login shell. usermod -s /usr/local/bin/sleepshell remoteuser
If you want to do it manually, open the /etc/passwd file and change the seventh field (the shell field) to /usr/local/bin/sleepshell. For example, to set the login shell of the user "remoteuser" you would edit its /etc/passwd record from: x:1022:100:,,,:/home/remoteuser:/bin/bash
to x:1022:100:,,,:/home/remoteuser:/usr/local/bin/sleepshell
(Note: this is just an example!) 7) Test the SSH account. Connection: 192.168.0.25 4567 192.168.0.1 22
Break the execution with Ctrl-C or by sending a SIGTERM signal to the sleepshell process. The SSH will be closed. 8) You are done. |
Download.
License.
Sleep Dummy Shell (SleepShell). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Browse the source files (0.0.2).Questions, comments, suggestions.You can send your questions, comments or suggestions by email. Don't hesitate to contact the author by email (mario@mariovaldez.org). |
MV.net: | inicio / home | documentos / documents | software / software | personal / personal | blog |
búsqueda / search | estadísticas / statistics | privacidad / privacy | webapps | a / f | e / l |
Copyright ©1994-2024 by Mario A. Valdez-Ramírez. |