Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Oct 28, 2013 4:54 pm 
Offline
Senior Newbie

Joined: Mon Oct 07, 2013 5:01 pm
Posts: 5
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) I see the command:

Code:
. /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

Code:
. /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:

Code:
 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


Top
   
PostPosted: Tue Oct 29, 2013 3:59 pm 
Offline
Senior Newbie

Joined: Mon Oct 07, 2013 5:01 pm
Posts: 5
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.

Code:
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


Top
   
PostPosted: Tue Oct 29, 2013 11:01 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
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.)


Top
   
PostPosted: Wed Oct 30, 2013 4:00 pm 
Offline
Senior Newbie

Joined: Mon Oct 07, 2013 5:01 pm
Posts: 5
Vance,

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

thomas


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group