LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 06-16-2016, 04:49 PM   #1
msdosslave
LQ Newbie
 
Registered: Jun 2016
Posts: 12

Rep: Reputation: Disabled
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.
 
Old 06-16-2016, 05:11 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
One of many vi command sheets.
 
Old 06-16-2016, 05:20 PM   #3
msdosslave
LQ Newbie
 
Registered: Jun 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
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.
 
Old 06-17-2016, 12:19 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by msdosslave View Post
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.
Old 06-17-2016, 01:57 AM   #5
msdosslave
LQ Newbie
 
Registered: Jun 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
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.
 
Old 06-17-2016, 02:27 AM   #6
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,974
Blog Entries: 33

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
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.
 
Old 06-17-2016, 10:42 AM   #7
msdosslave
LQ Newbie
 
Registered: Jun 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by beachboy2 View Post
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
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.
 
Old 06-17-2016, 11:21 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by msdosslave View Post
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.
Old 06-17-2016, 11:22 AM   #9
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,974
Blog Entries: 33

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
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:

Code:
vim martians
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.
Old 06-17-2016, 11:42 AM   #10
msdosslave
LQ Newbie
 
Registered: Jun 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Reading and trying. Will get back soon. Thanks for your help guys.
 
Old 06-17-2016, 12:31 PM   #11
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Dammit, I didn't know ZZ, I use :x to exit and save ... methinks I need a refresher course on vi.
 
Old 06-17-2016, 12:48 PM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
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.
 
Old 06-17-2016, 12:53 PM   #13
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
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.
 
Old 06-17-2016, 03:28 PM   #14
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,974
Blog Entries: 33

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
msdosslave,

How are you getting on with vi/vim?

Don't beat yourself up too much. There is always nano as mentioned earlier by ondoho.

nano guides:

http://mintaka.sdsu.edu/reu/nano.html

http://www.howtogeek.com/howto/42980...e-text-editor/
 
1 members found this post helpful.
Old 06-18-2016, 08:24 PM   #15
msdosslave
LQ Newbie
 
Registered: Jun 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by beachboy2 View Post
msdosslave,

How are you getting on with vi/vim?

Don't beat yourself up too much. There is always nano as mentioned earlier by ondoho.

nano guides:

http://mintaka.sdsu.edu/reu/nano.html

http://www.howtogeek.com/howto/42980...e-text-editor/
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Dual-Boot Ubuntu 15.04/14.10 And Windows 10/8.1/8: Step By Step Tutorial With Screenshots LXer Syndicated Linux News 0 07-15-2015 12:42 AM
LXer: Installation tutorial of XenApp 6.5(Citrix Server) Step by Step LXer Syndicated Linux News 0 05-25-2013 02:11 PM
DISCUSSION: Add a Program to the Applications Menu - A step-by-step tutorial ruguloo LinuxAnswers Discussion 2 04-16-2012 09:51 PM
I need a step by step help to instal Suse 9.3 Pro on the same hdd as XP Home & 2003 suse91pro Linux - General 4 09-07-2005 01:15 PM
Installing Mandrake Linux 10, step by step tutorial for Windows users lucat Linux - Newbie 0 06-12-2004 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration