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

cat /dev/urandom doesn't work in unprivileged LXC containers (e.g. Proxmox) #280

Closed
billyprice1old opened this issue Sep 1, 2018 · 14 comments
Assignees
Labels

Comments

@billyprice1old
Copy link

hi there sometime when i do this on it get stuck at downloading the easyrsa tar.gz file does anyone know why but it work's fine on nyr

@iProdigy
Copy link
Contributor

iProdigy commented Sep 2, 2018

Can you try running:
wget -O ~/EasyRSA-3.0.4.tgz https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.4/EasyRSA-3.0.4.tgz

(Nyr's script falls-back to curl when wget doesn't work while this script only uses wget. If you aren't able to wget that file, this script will need to include a similar fall back).

@angristan
Copy link
Owner

Hi @billyprice1 are you getting any error?

@billyprice1old
Copy link
Author

HI there @angristan i am still getting this issue it just get stuck here https://i.imgur.com/gw6sxbt.png yet on the nyr installer it works

@angristan
Copy link
Owner

angristan commented Sep 2, 2018

Wow that's weird. But I can't say for sure if this is wget or a command afterwards.

Can you try executing these few lines by hand and see if you can reproduce the issue ?

https://github.com/angristan/openvpn-install/blob/master/openvpn-install.sh#L533#L547

@billyprice1old
Copy link
Author

Hmm it don't seem to break there SERVER_CN="cn_$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 16 | head -n 1)" is where it stops and experience the same behavior also if it helps i am running lxc with proxmox and ubuntu 16.04 it only seem to happen with that like on scaleway etc it works but even on my dedi it happens in lxc

@angristan
Copy link
Owner

Maybe a /dev/urandom issue then. Does it exist inside your container?

See https://lists.linuxcontainers.org/pipermail/lxc-users/2015-June/009402.html

@angristan
Copy link
Owner

I found this: QuickBox/QB#50

@angristan
Copy link
Owner

Can you test these 3 commands inside you container:

tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 16 | head -n 1
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1
head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1

@billyprice1old
Copy link
Author

head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1 this command run but the other 2 does not

@angristan
Copy link
Owner

OK. What kind of output does it give you ? A random alphanumeric string?

If it does, I will update the script to address your use case.

@billyprice1old
Copy link
Author

It gives me a string of charaters

@angristan
Copy link
Owner

OK, thanks

@angristan angristan self-assigned this Sep 2, 2018
@angristan angristan changed the title Stuck on generating Rsa key cat /dev/urandom doesn't work in unprivileged LXC containers (e.g. Proxmox) Sep 2, 2018
@billyprice1old
Copy link
Author

Are you going to make a custom branch for lxc or something or change the main branch and use head instead of tr

@angristan angristan added bug and removed support labels Sep 2, 2018
@angristan
Copy link
Owner

I'm going to use head on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants