DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Security

OpenBSD Security Functionally paranoid!

Reply
 
Thread Tools Display Modes
Old 18th May 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
Spam Deminer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 262
Default

Quote:
Originally Posted by TheTKS View Post
And like hitest, it may be time for me to use vi enough to actually learn it, even if I now better know how to use nano.
TKS
Interesting morning. Ran a little experiment and re-installed an OpenBSD 6.5 system and forced myself to mostly use vi for initial set-up. I did some reading yesterday to re-familiarize myself with basic usage of vi (command and insert modes, and how to save). I was able to successfully use vi to edit pf.conf, create a new doas.conf file, and create a new /etc/hostname.iwn0 file.
I still do like to use sudo occasionally, but , ran into trouble trying to edit my existing /etc/sudoers file. I did what was suggested and could not save the file?! Did the remaining files with nano. That was odd. I have more to learn about vi. Enjoyable and frustrating.

Addition: Spent the afternoon and evening tinkering with vi. I am a bit more comfortable with vi.
__________________
hitest

Last edited by hitest; 19th May 2019 at 04:19 AM. Reason: Addition- added hours later
Reply With Quote
Old 20th May 2019
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 107
Default

Quote:
Originally Posted by frcc View Post
I think most BSD & Linux distro's come with "ed" installed, so, in some difficult situations you do have a minimal "line editor"
I've been there. Vi was not avaialble, only ed.

Quote:
Originally Posted by jggimi View Post
And there's a fun book to go with it. Ed Mastery, by Michael W. Lucas.
Its a good book. I found ed is quite nice to use after a bit of practice..
Reply With Quote
Old 21st May 2019
jmccue jmccue is offline
Real Name: John McCue
Port Guard
 
Join Date: Aug 2012
Location: here
Posts: 23
Default

Hi

Did not see this link (flak.tedunangst.com) in the tread, but I found it very informative

John

Last edited by jmccue; 21st May 2019 at 10:12 PM. Reason: grammer
Reply With Quote
Old 3rd June 2019
braveheart braveheart is offline
New User
 
Join Date: May 2019
Posts: 2
Default

I use the ee text editor. It comes standard with FreeBSD. I know you need to installl it as a package or from the ports tree, so that ED Mastery book suggested maybe a better place to start, unless you need to use some GNU/Linux distro that doesn't have it installed by default anymore. I wish the OpenBSD communal packages came with the more advanced text editor based on ee, ie. aee or I think its xae for GUI interfaces, (its a long time since I have used FreeBSD).
As far as doas.conf is concerned, the Author inside the man page is Ted Unagast (have I spelled his name correctly?). Anyway, search for his doas pamphlet mastery webpage with Chromium, it doesn't seem to work with other web browsers, get security certificate errors with Firefox and Lynx I think. But his document is not too long but covers the essentials. Its getting a bit old, so some of the contents may need updating - ie. the OP that replied to you said you might have found a bug.

Anyway, Take Care and Happy Reading/Experimenting

BraveHeart
Reply With Quote
Old 3rd June 2019
ibara's Avatar
ibara ibara is offline
Real-life IT professor
 
Join Date: Jan 2014
Posts: 688
Default

Quote:
Originally Posted by braveheart View Post
I use the ee text editor. It comes standard with FreeBSD. I know you need to installl it as a package or from the ports tree, so that ED Mastery book suggested maybe a better place to start, unless you need to use some GNU/Linux distro that doesn't have it installed by default anymore. I wish the OpenBSD communal packages came with the more advanced text editor based on ee, ie. aee or I think its xae for GUI interfaces, (its a long time since I have used FreeBSD).
I manage the editors/ee package. I also have a (never committed) port of aee (which comes with xae). Never thought anyone would want it but I can put it in if people do.
Reply With Quote
Old 15th June 2019
johnR johnR is offline
Port Guard
 
Join Date: Nov 2017
Posts: 37
Default

Quote:
Originally Posted by hitest View Post
I still do like to use sudo occasionally, but , ran into trouble trying to edit my existing /etc/sudoers file. I did what was suggested and could not save the file?!
/etc/sudoers may have read-only permissions, in which case you'd need to add an exclamation mark to the vi :wq command to allow vi to write to the file, eg. :wq!

You should use visudo to edit the sudoers file, not plain vi.

Last edited by johnR; 15th June 2019 at 12:13 PM.
Reply With Quote
Old 15th June 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
Spam Deminer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 262
Smile

Quote:
Originally Posted by johnR View Post
/etc/sudoers may have read-only permissions, in which case you'd need to add an exclamation mark to the vi :wq command to allow vi to write to the file, eg. :wq!

You should use visudo to edit the sudoers file, not plain vi.
Thank you! Yes. Noted for future reference. This experience with editing /etc/doas.conf was indeed valuable. My default editor is now vi not nano.
__________________
hitest
Reply With Quote
Old 3 Weeks Ago
ripe's Avatar
ripe ripe is offline
Fdisk Soldier
 
Join Date: Feb 2013
Location: Haute-Garonne, France
Posts: 67
Default

I am trying ed and I am reading Ed Mastery, I fall in love.
Reply With Quote
Old 3 Weeks Ago
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
Spam Deminer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 262
Smile

Quote:
Originally Posted by ripe View Post
I am trying ed and I am reading Ed Mastery, I fall in love.
I'm starting to get comfortable with simple vi commands. I had a look at the ed wikipedia entry; it appears daunting.
I'm glad that you like ed.
__________________
hitest
Reply With Quote
Old 3 Weeks Ago
LeFrettchen's Avatar
LeFrettchen LeFrettchen is offline
Marveled user
 
Join Date: Aug 2012
Location: France
Posts: 357
Default

vim is pretty similar to vi, and is also the default git editor when commiting...

The command
Code:
$ git commit
will launch vim
__________________
The secret of wisdom is not wisdom itself, it's the road that leads us there.
Reply With Quote
Old 3 Weeks Ago
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 107
Default

Quote:
Originally Posted by hitest View Post
I'm starting to get comfortable with simple vi commands. I had a look at the ed wikipedia entry; it appears daunting.
I'm glad that you like ed.
Those poor wiki people just never had a good ed teacher. Vi is ed plus many more commands piled on top. So vi is more work to learn than ed. Ed is the simplest no mouse editor ever made. It has only what you need to edit text, and nothing that you don't need. Let the editor wars begin!

But seriously, the only part that is work to learn is editing a line with basic regular expressions. You will have to become one with them to become fast. I have never been good with re because I rarely had a need for them, but ed makes me use them every day so eventually it will become automatic.

What made me curious about ed was I once came across a comment by a writer who said he learned ed to help him beat writer's block. He said ed makess him focus on the line he is editing, so he is no longer distracted by the surrounding text. I became interested in it because I realized the way an editor is designed can make your mind work in a different way.

Last edited by Prevet; 3 Weeks Ago at 03:58 AM.
Reply With Quote
Old 3 Weeks Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,630
Default

I use ed(1) for specific tasks only. I find it particularly useful for adding new line characters to markup languages such as html or xml. And I use it in situations where no other editor is available. And sometimes in scripts.

But my use excludes regular expressions. Even though there's a large chapter on the use of them in Ed Mastery, and I've gone through the exercises. Several times.

I hate regular expressions. For me, that way lies madness.
Reply With Quote
Old 3 Weeks Ago
frcc frcc is offline
Don't Worry Be Happy!
 
Join Date: Jul 2011
Location: hot,dry,dusty,rainy,windy,straight winds, tornado,puts the fear of God in you-Texas
Posts: 154
Default

My 2 cents..........
"ed" of course has its roots based in the development of the Unix OS.

Back in the day (mid to late 80's and early 90's) it was the only way to edit what you might consider .conf or batch files on certain IBM (Tm) mainframes as used in the Nuclear Power Plant Simulation Industry.
Following a short learning curve (being a paid consultant ) I found "ed" in this particular usage an exceptional well suited tool. Since simulation involves the monitoring, calculation, display of many variables, "ed" facilitated exact methods to alter these files to inject failure of various degree affecting simulation. As stated earlier by a previous poster it allows mental concentration on a line by line basis allowing one to focus on the technical requirements of that line. Since "ed" was the only "line editor" provided on the mainframe it was the "only" game in town. Would I have preferred another editor for this purpose?, given the technology at the time probably not. And of course in the end it didn't matter as it was the only tool provided.

Today I have greatly reduced needs for editing files. Therefore I use nano daily for .conf files and geany when fooling around with "freebasic" . Since some of you have experienced problems with .conf file editing using nano I scrutinize those files closer when using nano or if I experience problems can manage them using vi or ed.

In the end what editor or processor you choose is normally driven by convenience and suitability
and of course personal choice.

Last edited by frcc; 3 Weeks Ago at 09:19 PM. Reason: clarify and correct
Reply With Quote
Old 3 Weeks Ago
ripe's Avatar
ripe ripe is offline
Fdisk Soldier
 
Join Date: Feb 2013
Location: Haute-Garonne, France
Posts: 67
Default

Nice to read all this guys.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Doas.conf question staus OpenBSD General 6 8th November 2018 03:07 PM
Restrict doas.conf to syspatch only bsd007 OpenBSD Security 19 19th October 2018 01:05 AM
DOAS(1) rules jjstorm OpenBSD General 8 11th April 2016 08:09 PM
Doas has logging? cpaulette OpenBSD General 1 13th March 2016 10:24 AM
doas package Peter_APIIT OpenBSD General 2 1st November 2015 07:45 AM


All times are GMT. The time now is 06:58 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick