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

A little misleading. "nosudo" eventually requiring sudo? #70

Closed
archae0pteryx opened this issue May 28, 2016 · 9 comments
Closed

A little misleading. "nosudo" eventually requiring sudo? #70

archae0pteryx opened this issue May 28, 2016 · 9 comments

Comments

@archae0pteryx
Copy link

Am I naive?

@aydun
Copy link

aydun commented Jun 3, 2016

You don't need sudo if you use the '-f' or '--file-based' option. That creates a file in your existing webserver. You might need to change your .htaccess to allow access to the specified directory

@jflattery
Copy link

So do you just run the python command without sudo?

STEP 4: You need to run this command on staff.example.com (don't stop the python command until the next step).

sudo python -c "import BaseHTTPServer; \ h = BaseHTTPServer.BaseHTTPRequestHandler; \ h.do_GET = lambda r: r.send_response(200) or r.end_headers() or r.wfile.write('____'); \ s = BaseHTTPServer.HTTPServer(('0.0.0.0', 80), h); \ s.serve_forever()"

@aydun
Copy link

aydun commented Jun 6, 2016

No, you don't run that command but use your existing webserver.

Part of the validation is to retrieve a file from your web server. If you do have sudo you can run that one-line command to handle the validation request. If you don't have sudo, when you run sign_csr.py command, add the '-f' option. That eventually tells you to create a file with a specific name and content and make that available via a specified URL on your existing web server. After the validation is successful you can remove the file.

@brentonstrine
Copy link

Where do I put the --file-based flag? When I tried to run the python script with it

$ python sign_csr.py --public-key --file-based user.pub domain.csr > signed.crt

it said:

sign_csr.py: error: argument -p/--public-key: expected one argument

So then I removed the --public-key since it's expecting only one argument.

python sign_csr.py --file-based user.pub domain.csr > signed.crt

and then it said:

sign_csr.py: error: argument -p/--public-key is required

@aydun
Copy link

aydun commented Jun 14, 2017

user.pub needs to follow --public-key (it's saying the public key is stored in a file called user.pub) so try:

$ python sign_csr.py --file-based --public-key user.pub domain.csr > signed.crt

@berot3
Copy link

berot3 commented Nov 22, 2017

but still, wouldn't it be possible to use another port instead of port 80? just some random high port. that might make it possible to run it without sudo?

edit: sorry, just saw you wrote that here: #67 (comment)

so why not make it default?

@aydun
Copy link

aydun commented Nov 23, 2017

When Let's Encrypt does the validation, it connects to your server on port 80 to retrieve the challenge. You can't change which port it connects to. There are several ways to do that:

  1. stop your normal webserver on port 80 and run the temporary one: python command above. This requires sudo to use port 80
  2. use your normal webserver on port 80: --file-based option
  3. run the temporary server (python command) on a high port AND configure your normal port 80 webserver to redirect/proxy the challenge request to the temporary server: as described in #67 (comment)

@d3v-null
Copy link

This took a bit of digging for me to get, perhaps this should be more obvious in the readme, since I would imagine most people would be using this repo because they don't have root on their webserver.

@diafygi
Copy link
Owner

diafygi commented Mar 13, 2018

If you use the --file-based option, and you have the ability to point port 80 to a particular folder without sudo, you can just copy and paste the file into your website's folder.

@diafygi diafygi closed this as completed Mar 13, 2018
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

7 participants