ProblemFollowing Secure Communications with OpenVPN tutorial

I am trying to set up an openvpn server on my linode but ran into a problem I can't figure out. In the "Initializing Public Key Infrastructure" section of the tutorial found here (https://library.linode.com/networking/o … 04-precise">https://library.linode.com/networking/openvpn/ubuntu-12.04-precise) I see the command:

. /etc/openvpn/easy-rsa/2.0/vars

I do that (as a regular user) and get the expected outcome. However, when I go to the next step

. /etc/openvpn/easy-rsa/2.0/clean-all

I get unexpected outcome, I am told the script can not create the needed directory. If I run the command as:

 sudo /etc/openvpn/easy-rsa/2.0/clean-all

I am told I need to source the vars file first - seems like I had just done that!

I am running as a regular user and so try with sudo - the error is that the "." is 'command not found'. What is that "." at the beginning of the line anyway? How do you get around it?

thomas

3 Replies

Hmmm, I seem to have solved the problem (though I am still mystified by the leading "." in the commands in the tutorial). Turns out I couldn't get this to do this by logging in as my normal user and then using sudo but if I did a switch user to the root user and issued the commands everything worked fine.

sudo su root

Not sure what the difference is between being root and using sudo in this case … other than one worked and one didn't!

thomas

The dot "." causes the shell to read and execute the commands in the named file.

You ran into some problems because a sudo environment doesn't inherit all the settings of the invoking environment. You can run sudo su - to get a root shell, then execute your commands as root, and type exit to return to your original user. (Which is mostly what you did.)

Vance,

Thanks for the clear explanation. I have been using Linux for 8 or so years and had not run across that.

thomas

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct