Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
06-16-2016, 04:49 PM
|
#1
|
LQ Newbie
Registered: Jun 2016
Posts: 12
Rep: 
|
upd1 OPENVPN install using tutorial: every step is war for newbie - need advices
Hello.
I got OPENvpn tutorial from my friend about a year ago.
Seems it works but every step is very hard for me as I'm totally lost without double mouse click and color interface  And sorry for my Eng.
UPD1
Here I am again
So after vi problem I faced another one:
The tut requires following action:
Quote:
cd /etc/openvpn/
make-cadir easy-rsa
ln -s /etc/openvpn/easy-rsa/keys /etc/openvpn/keys
cd easy-rsa
. ./vars
./clean-all
./build-ca
./build-key-server server
./build-dh
openvpn --genkey --secret tls.key
./build-key client1
cd /etc/openvpn
mkdir client
cp /etc/openvpn/keys/ca.crt .
cp /etc/openvpn/keys/client1.key .
cp /etc/openvpn/keys/client1.crt .
cp /etc/openvpn/keys/dh2048.pem .
cp /etc/openvpn/keys/tls.key .
|
So my questions are:
1) ln -s /etc/openvpn/easy-rsa/keys /etc/openvpn/keys
When I'm trying to create this link it's nothing going on. It's not appearing at /etc/openvpn/
And /etc/openvpn/easy-rsa/keys is empty too. Does this command just creating a shortcut to the folder? If so may I make it manually as a shortcut. If not - what's my mistake?
2) cd easy-rsa
. ./vars
./clean-all
./build-ca
./build-key-server server
./build-dh
When I cd to easy-rsa it goes fine but what this mean?
Are this lines commands or output? Just don't understand.
. ./vars
./clean-all
./build-ca
./build-key-server server
./build-dh
3) openvpn --genkey --secret tls.key
./build-key client1
Again (command or line?) - the key seems generated normally but what's that?
./build-key client1
_____________________________________________________________
[1st question solved]
vi = nano
http://www.linuxquestions.org/questi...2/#post5562668
Anyway my first question is:
Vim thing. During the installation I can see next steps
Quote:
...
# vi /etc/sysctl.conf
|
After this command I can understand the SSH window goes to Vim mode and it;s absolutely unclear.
Last edited by msdosslave; 06-24-2016 at 01:40 AM.
|
|
|
06-16-2016, 05:11 PM
|
#2
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep: 
|
|
|
|
06-16-2016, 05:20 PM
|
#3
|
LQ Newbie
Registered: Jun 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by Emerson
|
I saw this and other commands. I can't find exact buttons combination and don't know how to find it.
UPD. Nope, this is new, thank you. Trying.
Last edited by msdosslave; 06-16-2016 at 05:22 PM.
|
|
|
06-17-2016, 12:19 AM
|
#4
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by msdosslave
I'm totally lost without double mouse click and color interface
|
both are available on linux systems.
a link to the tutorial in question would help.
and, more importantly, YOU have to get some clarity:
- what are the steps
- where are you stuck...
if you want US to be able to help.
btw, you wouldn't be the first person who rebooted their computer because they couldn't get out of vi.
and vi is just a text editor.
most probably you can use nano instead.
|
|
1 members found this post helpful.
|
06-17-2016, 01:57 AM
|
#5
|
LQ Newbie
Registered: Jun 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by ondoho
both are available on linux systems.
a link to the tutorial in question would help.
and, more importantly, YOU have to get some clarity:
- what are the steps
- where are you stuck...
if you want US to be able to help.
btw, you wouldn't be the first person who rebooted their computer because they couldn't get out of vi.
and vi is just a text editor.
most probably you can use nano instead.
|
I see.
The part where I'm stuck - the bold part:
Quote:
apt-get install openvpn easy-rsa unzip zip -y
apt-get update
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1 - This command is input in vi after down line cursor
sysctl -p
cd /etc/openvpn
unzip s2s.zip
vi /etc/openvpn/s2s.conf
dev tun0
remote 192.xxx.xxx.xxx
...
|
I hope just to get some clarity with vi first. Thanks for your attention.
Last edited by msdosslave; 06-17-2016 at 02:00 AM.
|
|
|
06-17-2016, 02:27 AM
|
#6
|
Senior Member
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS
Posts: 4,314
|
msdosslave,
For the benefit of those who find vi a bit of a pain (including me), please try vim which is vi-modified:
This Quick Start Guide clearly explains the workings of vim:
http://www.oregonwebradio.net/backup...uickstart.html
Last edited by beachboy2; 06-17-2016 at 07:03 AM.
|
|
|
06-17-2016, 10:42 AM
|
#7
|
LQ Newbie
Registered: Jun 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by beachboy2
|
Doesn't vi and vim not the same?
The problem is: I saw this tut. but it's not work for me as my brain refuses this logic. Every step is a fight
So: I'm trying to get this result in terminal
Quote:
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
net.ipv4.ip_forward = 1
|
All I can get using your and Emerson too helps:
Quote:
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
ipv4.ip_forward = 1
|
You see the difference? 3rd line lost
I just cant left # on 3rd line and create emty 4th one to paste net.ipv4.ip_forward = 1
Also net. disappearing when I'm trying to paste it from buffer.
Where is my mistake?
UPD. I moved forward with this via ftp. Just opened /etc/sysctl.conf to add last line. As I see it's the same just different ways. But the question is still opened - how to add last line to a document via vim(I realized what I need just now  )
Last edited by msdosslave; 06-17-2016 at 11:06 AM.
|
|
|
06-17-2016, 11:21 AM
|
#8
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Quote:
Originally Posted by msdosslave
I hope just to get some clarity with vi first. Thanks for your attention.
|
Assumes root or sudo or equivalent.
Code:
vi + /etc/sysctl.conf
will open vi at the last line of the file.
Press o to open a new line and insert
Code:
net.ipv4.ip_forward = 1
Press Escape (I always hit it twice to be certain) and type
ZZ or :wq!
to exit and save upon exit.
tips:
Code:
vi + /path/to/file # opens at EOF
vi +<num> /path/to/file #open on line <num>
Last edited by Habitual; 06-17-2016 at 11:22 AM.
|
|
1 members found this post helpful.
|
06-17-2016, 11:22 AM
|
#9
|
Senior Member
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS
Posts: 4,314
|
msdosslave,
vi and vim are similar but different.
The # you placed is superfluous. What does your 3rd line (contains only #) actually do?
# is only needed to "comment out" a description, such as:
Code:
# This is my new script
What I think you need is this, but I may be wrong:
Code:
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
net.ipv4.ip_forward = 1
I have just created a new file called martians in vim using the above.
EDIT
Quote:
How to add last line using vim?
|
In Terminal:
Press i for INSERT Mode.
Use Down arrow to move cursor to last line.
Use Right arrow to move cursor to end of last line.
Press Enter to drop down to the line below.
Add your new text.
Press Esc to go into COMMAND Mode.
Next, to save the changes to the file, type
:wq
Press Enter.
NB If the file is brand new, type :wq mynewfile
and then press Enter.
PS Habitual's method is much neater.
Last edited by beachboy2; 06-17-2016 at 11:55 AM.
|
|
1 members found this post helpful.
|
06-17-2016, 11:42 AM
|
#10
|
LQ Newbie
Registered: Jun 2016
Posts: 12
Original Poster
Rep: 
|
Reading and trying. Will get back soon. Thanks for your help guys.
|
|
|
06-17-2016, 12:31 PM
|
#11
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep: 
|
Dammit, I didn't know ZZ, I use :x to exit and save ... methinks I need a refresher course on vi.
|
|
|
06-17-2016, 12:48 PM
|
#12
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Quote:
Originally Posted by Emerson
Dammit, I didn't know ZZ, I use :x to exit and save ... methinks I need a refresher course on vi.
|
All I know about vi:
Code:
vi + - eof
ZZ or :wq!
number > Shift+G - goto line number.
[oO] open
$ eol
^ beginning of line.
A append
I am a caveman in vi.
The dude abides.
|
|
|
06-17-2016, 12:53 PM
|
#13
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep: 
|
Actually you shouldn't use :wq! ... :wq is write and exit, :q! is exit without save ... if I recall correctly, that is. Still haven't taken that refresher.
|
|
|
06-18-2016, 08:24 PM
|
#15
|
LQ Newbie
Registered: Jun 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by beachboy2
|
Yeah, I should listen to ondoho)
Nano is pure revelation. It's just made exactly what I need. vi is fiasco, however I can do this action in two different ways now without vi. I believe I may come back to vi later.
I'm still on my way, and very soon I'll be here with new headache. Hope you'll be here) Thanks
|
|
|
All times are GMT -5. The time now is 09:39 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|