Comments (11)
Happy to help a fellow french open source developer :)
Thanks for taking the time to debug the issue also !
from sshportal.
from sshportal.
@vmarchaud fixed with #26 :)
thank you for your debugging help
from sshportal.
Hi @vmarchaud,
It certainly happens something bad during the initialization; the quick fix is:
rm sshportal.db; docker rm -f sshportal
(cleanup everything)- start again
Can you help me to debug? I need:
- your
sshportal.db
file (it's safe if you didn't configure anything with the shell) - if you can't send me your
sshportal.db
file, you can give me more info easily withdocker rm -f sshportal; docker -d --name=sshportal -v "$(pwd):$(pwd)" -w "$(pwd)" moul/sshportal:latest -v; docker logs sshportal
(recreating sshportal in verbose mode on the same sshportal.db file and give me the output logs)
Thank you for your help
from sshportal.
Here is the db : db.zip
I also tried your second point but it failed, i only got in the container log :
sshportal version 1.6.0+dev (c8fb1037621034abc3b4af85c20e8b8bde1fbf69)
And then the container crashed. I got few more logs (docker daemon log) just after i start the container in verbose, don't think thats helpful but in case :
déc. 22 11:13:14 mercury dockerd[9676]: time="2017-12-22T11:13:14.207278688+01:00" level=info msg="No non-localhost DNS nameservers are left in resolv.conf. Using default external servers: [nameserver 8.8.8.8 nameserver 8.8.4.4]"
déc. 22 11:13:14 mercury dockerd[9676]: time="2017-12-22T11:13:14.207343838+01:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]"
déc. 22 11:13:14 mercury dockerd[9676]: time="2017-12-22T11:13:14+01:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/44df53e34be297c7571261cc1d46fd02f5306fbbe1aa946eefb4a3fa708486ea/shim.sock" debug
déc. 22 11:13:14 mercury dockerd[9676]: time="2017-12-22T11:13:14.644185733+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
déc. 22 11:13:14 mercury dockerd[9676]: time="2017-12-22T11:13:14+01:00" level=info msg="shim reaped" id=44df53e34be297c7571261cc1d46fd02f5306fbbe1aa946eefb4a3fa708486ea module="containerd/tasks"
from sshportal.
Thank you,
I started a sshportal using your database, and it worked
$ ssh sshportal -l invite:iyxu6dQJoVvEpn26
Welcome admin!
Your key is now associated with the user "admin@sshportal"
$ ssh sshportal
__________ _____ __ __
/ __/ __/ // / _ \___ ____/ /____ _/ /
_\ \_\ \/ _ / ___/ _ \/ __/ __/ _ '/ /
/___/___/_//_/_/ \___/_/ \__/\_,_/_/
config>
Can you do an additional test to help me help you :)?
docker rm -f sshportal; docker -d --name=sshportal -v "$(pwd):$(pwd)" -w "$(pwd)" moul/sshportal:latest -D; docker logs -f sshportal
(same command as in my previous comment but use-D
for debug instead of-v
for version printing)- use the ssh client with verbose output:
ssh -vvv localhost -p 2222 -l invite:<token>
And send me the detail if you still have an issue,
thank you for your time
from sshportal.
My pleasure to help you :)
- https://pastebin.com/AeA39Pz5 : i regenerated a database in case you are wondering why the server private key isnt the same
- https://pastebin.com/DESjXva1 : i removed few useless verbose log (ssh client telling that it didnt pickup some of my en vars)
I'm guessing that it might come from my ssh client, i will try with some others in the mean time
from sshportal.
The following line shows that sshportal received (and registered) your public ssh key when you connected using the invite token
�[35m(/go/src/github.com/moul/sshportal/main.go:236)�[0m
�[33m[2017-12-22 21:45:05]�[0m �[36;1m[0.31ms]�[0m INSERT INTO "user_keys" ("created_at","updated_at","deleted_at","key","authorized_key","user_id","comment") VALUES ('2017-12-22 21:45:05','2017-12-22 21:45:05',NULL,'<binary>','ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPsB+cBPINCReI5b1LlVe90RrNUgUXledN+2zCNXD/R9/uUADQleRoh4f/zRWK0Nk7GmFxNyUyXGTlACxPn2X5zn1KU1dJtXs2mhJIgoWCLtNnkNwIpisyutFi7HNeVqXVYe/iXTP+TWiQAGxX8ZK4hIFjyY4vHOjML2zivgL3fnHzLrmn8gkXo66aCtexmuX1Xk6ILLj/FAEPOJxZPPr90WhiffDEJD/H0D0VY+pv6rLzZjMUrMy3fK+LcFKVPSdK4jpBpWncIfEmR0FvbMA3paiW5smz0wSivj6gWM1Tx5Vaptx2gx7QYl7+t5phe4qCoRGNGUyJ7aTK0w+9fK23
','1','created by sshportal')
�[36;31m[1 rows affected or returned ]�[0m
can you try:
- close your shell with ssh client (if not already done)
- start sshportal (if killed)
- connect using the
admin
user instead ofinvite:XXXX
?
if it works, the problem comes from the invite system that does not return a valid pty, your .ssh/config file probably contains a line I don't have that blocks the client when the PTY request fails
from sshportal.
Same behavior with admin user, the client fail after :
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: callback done
debug2: channel 0: open confirm rwindow 2097152 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
I don't have any ssh client configuration inside my ~/.ssh
However i tried inside a docker container like this (even with a clear db, the connection is refused), is there any thing that i miss to test directly with the ssh client of the container ?
docker run -v /path/to/private/key/:/id_rsa kroniak/ssh-client ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /id_rsa 172.18.0.1 -p 2222 -l admin
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '[172.18.0.1]:2222' (RSA) to the list of known hosts.
Permission denied (publickey).
from sshportal.
That's a nice idea to try to run the ssh client from withing docker, here the error is different: Permission denied (publickey).
can you try the invite:xxx
user from within docker? (if possible remove your database and start a new sshportal, so we are sure the invite token wasn't used)
Thank you for your patience :)
edit: from your pastebin, I can see that your ssh client loads a global configuration file:
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
Can you check that none of these options may be the cause?
from sshportal.
Good catch :)
It was this line : SendEnv LANG LC_*
that lead to undefined behavior. The weird things is that i doesn't match any of my env variables :
▶ env | grep LANG
LANGUAGE=en_US
LANG=en_US.UTF-8
GDM_LANG=en_US
As soon as i remove it, its works correctly so i think you should be able to replicate easily
from sshportal.
Related Issues (20)
- Can't purge access list db.
- Broken dependency on sabban/bastion HOT 1
- Dependency Dashboard
- Unable to connect to older Solaris hosts.
- [Feature] Allow all connections access to specified host HOT 1
- Bug when unassign-group on user HOT 12
- MySQL foreign key constraints HOT 3
- Import of ed25519 keys
- Running SSHPortal in a container how to connect to outside SQL DB HOT 1
- Feature add: config file as database HOT 1
- How to view session logs ? HOT 3
- How to connect sshportal HOT 4
- SSHPortal accepts the first key, then disconnects, even if there are multiple in ssh-agent.
- User "Admin" is added to each usergroup created. Unable to remove.
- Is this p2p communication?
- Hide sensitive data in docker compose
- Ubuntu 20 | sshportal: command not found HOT 5
- passwordless login? HOT 2
- Sessions are closed after port-forwarded connection completes HOT 4
- sshportal enable keyboard-interactive ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sshportal.