Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running sshttp #4

Closed
jkluch opened this issue Oct 16, 2015 · 4 comments
Closed

Problems running sshttp #4

jkluch opened this issue Oct 16, 2015 · 4 comments

Comments

@jkluch
Copy link

jkluch commented Oct 16, 2015

I'm trying to run this on a rasp pi.
I downloaded project,
modified nf-setup with
SSH_PORT=22
HTTP_PORT=4433
ran make
then if I run ./sshttpd -L 443
I get

sshttpd: Using HTTP_PORT=8080 SSH_PORT=22 and local port=443. Going background.
Using caps/chroot.
NS_Socket::bind_local::bind:Permission denied

and if I use sudo I get

sshttpd: Using HTTP_PORT=8080 SSH_PORT=22 and local port=443. Going background.
Using caps/chroot.
chroot: No such file or directory
chroot: No such file or directory

I also tried using authbind instead of sudo and I get

sshttpd: Using HTTP_PORT=8080 SSH_PORT=22 and local port=443. Going background.
Using caps/chroot.
Operation not permitted

Anyone able to help with this? Thanks

@aureq
Copy link

aureq commented Oct 17, 2015

The reason is because to bind to a port < 1024, you must be "root". Please note that it's a feature from the OS rather than a bug in sshttp.
Feel free to give it a try with a higher port so you can see the difference.

@jkluch
Copy link
Author

jkluch commented Oct 19, 2015

The reason is because to bind to a port < 1024, you must be "root"

Right. That's why I tried sudo and authbind because they should allow me to use restricted ports. I've tried random ports above 1024 but I get

sshttpd: Using HTTP_PORT=8080 SSH_PORT=22 and local port=5050. Going background.
Using caps/chroot.
Operation not permitted

which is similar to what I get when using authbind and port 443.

If I use sudo the output is still the same

sshttpd: Using HTTP_PORT=8080 SSH_PORT=22 and local port=5050. Going background.
Using caps/chroot.
chroot: No such file or directory
chroot: No such file or directory

I have an http server running on 80 and ssh on 22 so I'm not sure why I can't get this to run

@stealth
Copy link
Owner

stealth commented Oct 20, 2015

Yes, you need to run sshttp as root. it will then drop to specified user (default nobody)
and chroot to /var/lib/empty. Either create that directory, or use -R to specify another one.

@stealth
Copy link
Owner

stealth commented Oct 20, 2015

solved I guess

@stealth stealth closed this as completed Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants