My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 88: Session closed too fast
7 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by frysha...@gmail.com, Aug 27, 2010
What steps will reproduce the problem?
1. previous version work for listening from URL command
2. Session closed to fast
3.

What is the expected output? What do you see instead?
/usr/local/bin/shellinaboxd -d --port=4211 -t -s "/:$(id -u):$(id -g):HOME:"'/bin/bash -c "u=${url}; exec /usr/sbin/command listen \"\${u##*\\?}\""'
Loaded PAM suppport
Command line: /usr/local/bin/shellinaboxd -d --port=4211 -t -s /:0:0:HOME:/bin/bash -c "u=${url}; exec /usr/sbin/command listen \"\${u##*\\?}\""
Substituting "nobody's" primary group for "nogroup"
Listening on port 4211
Substituting "nobody's" primary group for "nogroup"
Accepted connection from 192.168.1.105:38663
Handling "GET" "//?stream"
Compressed response from 4884 to 2100
192.168.1.105 - - [27/Aug/2010:18:24:53 +0800] "GET //?stream HTTP/1.1" 200 2193
Accepted connection from 192.168.1.105:38664
Accepted connection from 192.168.1.105:38665
Handling "GET" "//styles.css"
Compressed response from 4935 to 1003
192.168.1.105 - - [27/Aug/2010:18:24:54 +0800] "GET //styles.css HTTP/1.1" 200 1135
Handling "GET" "//ShellInABox.js"
Compressed response from 164773 to 37588
192.168.1.105 - - [27/Aug/2010:18:24:54 +0800] "GET //ShellInABox.js HTTP/1.1" 200 37703
Accepted connection from 192.168.1.105:38666
Handling "POST" "//?"
Creating a new session: oJKOOL5nOVajeCKY-jriuw
Window size changed to 126x30
192.168.1.105 - - [27/Aug/2010:18:24:57 +0800] "POST //? HTTP/1.1" 200 157
Child terminated
Accepted connection from 192.168.1.105:38667
Handling "GET" "//favicon.ico"
Compressed response from 2307 to 1983
192.168.1.105 - - [27/Aug/2010:18:24:58 +0800] "GET //favicon.ico HTTP/1.1" 200 2079
Accepted connection from 192.168.1.105:38668
Handling "GET" "//beep.wav"
192.168.1.105 - - [27/Aug/2010:18:24:59 +0800] "GET //beep.wav HTTP/1.1" 200 911
Accepted connection from 192.168.1.105:38670
Handling "GET" "//beep.wav"
192.168.1.105 - - [27/Aug/2010:18:25:02 +0800] "GET //beep.wav HTTP/1.1" 200 911
Accepted connection from 192.168.1.105:38671
Handling "POST" "//?"
Failed to find session: oJKOOL5nOVajeCKY-jriuw
192.168.1.105 - - [27/Aug/2010:18:25:03 +0800] "POST //? HTTP/1.1" 400 458
Closing connection to 192.168.1.105:38671

What version of the product are you using? On what operating system?
shellinabox 2.10 | Centos 5.4

Please provide any additional information below.
command listen is an example
Sep 11, 2010
#1 frysha...@gmail.com
anyone have a same issue ?
Dec 31, 2010
#2 noeticpe...@gmail.com
I to, am having this issue. It's very frustrating!
Dec 31, 2010
#3 noeticpe...@gmail.com
more info! stupid enter key! 

I'm using the command mode to issue a svn checkout to help our developers get their dev environment setup. partway through it always dies with failed to find session.
Dec 31, 2010
#4 frysha...@gmail.com
Try to check the PAM config. I modified mine to

#%PAM-1.0
auth       required     pam_nologin.so
auth       include    system-auth
account    include    system-auth
session    include    system-auth
password   include    system-auth
Jan 3, 2011
#5 noeticpe...@gmail.com
FryShadow,

Do I create a new shellintheboxd file to put that pam information in? or the sshd pam config ?


Jan 3, 2011
#6 frysha...@gmail.com
this is mine:

# pwd 
/etc/pam.d

# ls -la | grep shellinabox
-rw-r--r--  1 root root     168 Sep 13 15:10 shellinabox

# more shellinabox 
#%PAM-1.0
auth	   required     pam_nologin.so
auth	   include	system-auth
account    include	system-auth
session    include	system-auth
password   include	system-auth

Jan 3, 2011
#7 noeticpe...@gmail.com
That actually prevents me from logging in at all. 

This is an LDAP'd system and my user is not local. When I try to log in it gives me login incorrect. this is after putting a shellinabox file in the /etc/pam.d directory. any ideas? File contents were copy/pasted.
Aug 2, 2011
#8 robinleepowell@gmail.com
I get the same issues with -s /:AUTH:HOME:SHELL , when it works at all (see https://code.google.com/p/shellinabox/issues/detail?id=106&q=AUTH )

The suggested pam.d given here doesn't help.  The only output I get on the page is:

- -------

Login incorrect
Login incorrect
Maximum number of tries exceeded (3)
Session closed.

- -------

As far as I can tell, only SSH and LOGIN methods work at all; has anyone ever gotten the AUTH/user method to work?

-Robin
Dec 1, 2013
#9 tombe...@gmail.com
I am getting a similar problem:
```
[root@luke:/etc/pam.d]# shellinaboxd --no-beep -s /:SSH -t -d
Command line: shellinaboxd --no-beep -s /:SSH -t -d
Listening on port 4200
Accepted connection from localhost:58928
Handling "GET" "/shell/"
localhost - - [01/Dec/2013:16:33:17 +0000] "GET /shell/ HTTP/1.0" 200 4967
Closing connection to localhost:58928
Accepted connection from localhost:58929
Handling "GET" "/shell/styles.css"
localhost - - [01/Dec/2013:16:33:17 +0000] "GET /shell/styles.css HTTP/1.0" 200 7286
Closing connection to localhost:58929
Accepted connection from localhost:58930
Handling "GET" "/shell/ShellInABox.js"
localhost - - [01/Dec/2013:16:33:17 +0000] "GET /shell/ShellInABox.js HTTP/1.0" 200 188602
Closing connection to localhost:58930
Accepted connection from localhost:58931
Handling "GET" "/shell/keyboard.png"
localhost - - [01/Dec/2013:16:33:17 +0000] "GET /shell/keyboard.png HTTP/1.0" 200 873
Closing connection to localhost:58931
Accepted connection from localhost:58932
Handling "GET" "/shell/keyboard.html"
localhost - - [01/Dec/2013:16:33:17 +0000] "GET /shell/keyboard.html HTTP/1.0" 200 3181
Closing connection to localhost:58932
Accepted connection from localhost:58933
Handling "POST" "/shell/?"
Creating a new session: v/ZHRnhu4kLbmbikeXVVeg
Window size changed to 71x40
localhost - - [01/Dec/2013:16:33:17 +0000] "POST /shell/? HTTP/1.0" 200 157
Closing connection to localhost:58933
Accepted connection from localhost:58934
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:17 +0000] "POST /shell/? HTTP/1.0" 200 169
Closing connection to localhost:58934
Accepted connection from localhost:58935
Handling "POST" "/shell/?"
Accepted connection from localhost:58936
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58936
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 158
Closing connection to localhost:58935
Accepted connection from localhost:58937
Handling "POST" "/shell/?"
Accepted connection from localhost:58938
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58938
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 158
Closing connection to localhost:58937
Accepted connection from localhost:58939
Handling "POST" "/shell/?"
Accepted connection from localhost:58940
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58940
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 158
Closing connection to localhost:58939
Accepted connection from localhost:58941
Handling "POST" "/shell/?"
Accepted connection from localhost:58942
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:20 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58942
localhost - - [01/Dec/2013:16:33:20 +0000] "POST /shell/? HTTP/1.0" 200 161
Closing connection to localhost:58941
Child terminated
Accepted connection from localhost:58943
Handling "POST" "/shell/?"
Failed to find session: v/ZHRnhu4kLbmbikeXVVeg
localhost - - [01/Dec/2013:16:33:20 +0000] "POST /shell/? HTTP/1.0" 400 458
Closing connection to localhost:58943

Handling "POST" "/shell/?"
Accepted connection from localhost:58936
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58936
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 158
Closing connection to localhost:58935
Accepted connection from localhost:58937
Handling "POST" "/shell/?"
Accepted connection from localhost:58938
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58938
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 158
Closing connection to localhost:58937
Accepted connection from localhost:58939
Handling "POST" "/shell/?"
Accepted connection from localhost:58940
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58940
localhost - - [01/Dec/2013:16:33:19 +0000] "POST /shell/? HTTP/1.0" 200 158
Closing connection to localhost:58939
Accepted connection from localhost:58941
Handling "POST" "/shell/?"
Accepted connection from localhost:58942
Handling "POST" "/shell/?"
localhost - - [01/Dec/2013:16:33:20 +0000] "POST /shell/? HTTP/1.0" 200 407
Closing connection to localhost:58942
localhost - - [01/Dec/2013:16:33:20 +0000] "POST /shell/? HTTP/1.0" 200 161
Closing connection to localhost:58941
Child terminated
Accepted connection from localhost:58943
Handling "POST" "/shell/?"
Failed to find session: v/ZHRnhu4kLbmbikeXVVeg
localhost - - [01/Dec/2013:16:33:20 +0000] "POST /shell/? HTTP/1.0" 400 458
Closing connection to localhost:58943
```
I have tried several other -s settings. Still get this. I am trying this on NixOS. I've build both using a Nix expression and configure/make.


Dec 1, 2013
#10 tombe...@gmail.com
I was able to get SSL working, but the session still closes right after I type in a username:
localhost - - [01/Dec/2013:13:06:30 -0500] "GET /enabled.gif HTTP/1.1" 200 912
Handling "POST" "/?"
localhost - - [01/Dec/2013:13:06:35 -0500] "POST /? HTTP/1.1" 200 407
localhost - - [01/Dec/2013:13:06:35 -0500] "POST /? HTTP/1.1" 200 161
Child terminated
Handling "POST" "/?"
Failed to find session: FcOP-UBevoCJDFQHeukSmA
localhost - - [01/Dec/2013:13:06:35 -0500] "POST /? HTTP/1.1" 400 458
Closing connection to localhost:59904
^CShutting down server
Closing connection to localhost:59907
Done

Dec 4, 2013
#11 konce...@gmail.com
I was having this issue as well under the SSH service.  You might want to ensure that your hostname resolves to the correct IP.  It would be nice for the error in debug to indicate the SSH/DNS failure rather than "Failed to find session" when this is the case.
Dec 6, 2013
#12 tombe...@gmail.com
I've tried both IP and hostname.
Dec 6, 2013
#13 konce...@gmail.com
Looking at the command you are running
"[root@luke:/etc/pam.d]# shellinaboxd --no-beep -s /:SSH -t -d"
Does "luke" resolve?  When shellinabox tries to open the ssh connection it does ssh .... user@host, in your case luke.  If luke doesn't resolve to an IP where ssh is listening then it will close quickly like you are experiencing.  You can resolve this by editing /etc/hosts if this is a standalone box and adding a line that is "luke <tab> <your pub ip>"  This makes the most sense if it is a static IP.  If it is dynamic you can put it in the line with 127.0.0.1.  The other option is getting the hostname to match up to dns properly so if your hostname is luke and your domain is acme.com then luke.acme.com needs to resolve to your IP.
Dec 6, 2013
#14 tombe...@gmail.com
Yeah, luke resolves. I've added it to my /etc/hosts, I can go to luke:4200 and it brings up the login, but as soon as I hit enter to write the password, it pops up with "Failed to find session" in the debug output and "Session closed" in the browser.
Sign in to add a comment

Powered by Google Project Hosting