froehr / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

shellinaboxd -s /:SSH:example.org after typing in login name, disconnect occurs #84

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run shellinabox with SSH service
2. attempt to login
3. disconnected before being able to type password

What is the expected output? What do you see instead?
Expected to login, same as using regular service which works fine.

What version of the product are you using? On what operating system?
2.10

Please provide any additional information below.
Seems to work perfectly only when trying ssh instead of auth it disconnects 
after typing the login name.

Original issue reported on code.google.com by schrepp...@gmail.com on 15 Aug 2010 at 11:19

GoogleCodeExporter commented 8 years ago
Ow, forgot to say running Debian Lenny, compiled shellinaboxd from sources 
downloaded here. 

Original comment by schrepp...@gmail.com on 15 Aug 2010 at 11:22

GoogleCodeExporter commented 8 years ago
You could try attaching "strace -f" to the shellinaboxd daemon process. This 
might shed some more light on what is happening.

Other than that, my best guess is that either you don't have ssh client and/or 
server software installed. Or your version of ssh doesn't like the command line 
flags that shellinaboxd gives it.

Original comment by zod...@gmail.com on 16 Aug 2010 at 5:33

GoogleCodeExporter commented 8 years ago
I had the same problem.
In my case the cause was the fact that I use a non-standard ssh port (other 
than 22).
Adding the following to the command line or to SHELLINABOX_ARGS in 
/etc/default/shellinabox solved the problem:
--service=/s:user:grp:HOME:'ssh user-ssh@localhost -p 12345'
Best,
Luca

Original comment by lucac...@gmail.com on 11 Oct 2010 at 11:57

GoogleCodeExporter commented 8 years ago
I have the same problem as schreppers, no solution yet.  Running on FreeBSD 8.1 
with shellinabox version 2.10 (revision 186) installed from ports tree.  No 
options changed -- just a basic install, leading to this issue.

This is a pretty big problem -- it makes shellinabox totally useless.  Perhaps 
the priority should be higher than Medium.

Original comment by dpp.ph...@gmail.com on 22 Nov 2010 at 10:04

GoogleCodeExporter commented 8 years ago
I'm running into the same symptom but I'm not sure if the problem is the same, 
I submitted ticket 112.

schreppers and dpp.phone are you using two-factor authentication for connecting 
to SSHd?

Original comment by BenPr...@gmail.com on 8 Feb 2011 at 3:19

GoogleCodeExporter commented 8 years ago
I ran in the same problem. I made a wrapper script that asks for a username and 
then proceed to execute the ssh command with arguments of your choice:
Using directly the ssh command was a no-go for me because I wanted to choose 
the username.

Sadly the script must be added in a predefined path (eg /usr/bin) because 
shellinabox 2.10 rejects custom paths.

In my case ssh was on port 2022.

#!/bin/bash
read -p "Username please:"
REPLY2="`echo $REPLY|tr -c 'A-Za-z0-9' '\0'`"
if [ "$REPLY" != "$REPLY2" ]; then
        echo "What is that, illegal characters in my prompt?"
elif [ "$REPLY" == "" ]; then
        echo "I asked nicely, retry when you're ready!"
else
        exec ssh -p 2022 $REPLY@localhost
fi

Original comment by decoy113...@gmail.com on 6 Mar 2012 at 9:45

GoogleCodeExporter commented 8 years ago
IIUIC, the root cause is the fact that the ssh daemon does not use port 22.  Is 
that the only issue?  If you were to change to port 22 would the issue be 
resolved?  I recognize that this isn't a work-around.  I just want to get to 
the root of the problem.

Original comment by beewoo...@gmail.com on 31 Mar 2012 at 9:42

GoogleCodeExporter commented 8 years ago
Same problem. 
Using NixOS, tried bulding using nix builder and make/configure. I can get SSL 
to work, but no matter what I do, the session get's closed "Child Terminated" 
"Failed to find session:" 

Tried different ports. Tried to change authentication method.

Using 2.14

Original comment by tombe...@gmail.com on 1 Dec 2013 at 10:11

GoogleCodeExporter commented 8 years ago
I wonder if this is the same problem as the SunOS folks are having.  You could 
try the patch in issue #58.

Original comment by beewoo...@gmail.com on 1 Dec 2013 at 11:04

GoogleCodeExporter commented 8 years ago
#58 seems to occur after login. I get the "Session Closed" right after hitting 
enter after typing the username.

Original comment by tombe...@gmail.com on 2 Dec 2013 at 12:07

GoogleCodeExporter commented 8 years ago
I had this issue as well, in my case it was that the hostname didn't resolve 
correctly.  You might want to double check that your hostname resolves to the 
address that you expect.

Original comment by konce...@gmail.com on 5 Dec 2013 at 2:18

GoogleCodeExporter commented 8 years ago
I've tried both IP and hostname.

Original comment by tombe...@gmail.com on 6 Dec 2013 at 4:10

GoogleCodeExporter commented 8 years ago
@beewoolie@gmail.com

I've been able to patch paths in NixOS to make shellinabox work, but I'd like 
to add the option have the SSH go to a non-standard port. Currently I do it by 
disabling the hostname checking ("Don't allow manipulation of the SSH command 
line through "creative" use of the hostname" in service.c) so my service string 
looks like -s '/:SSH:localhost -p 1234' -p 4321

That would host shellinabox on port 4321 and ssh into port 1234.

I'd rather there be an established way to do this rather than a command 
injection.

Original comment by tombe...@gmail.com on 29 Dec 2013 at 4:32

GoogleCodeExporter commented 8 years ago
Got this issue when I changed hostname on my server, what fixed it:

1. edit /etc/hosts
2. Change the oldHostname in the line 127.0.1.1 to your new hostname.

Original comment by karl.stj...@gmail.com on 28 Apr 2015 at 6:23