VectorLinux
October 24, 2014, 07:11:43 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1] 2
  Print  
Author Topic: One more humble suggestion...  (Read 7539 times)
blackbelt_jones
Member
*
Posts: 56


« on: August 29, 2007, 09:38:55 am »

It's not exactly a request for an application.

Some purists may object, but I'm sure that I'm not the only emacs user out there who would appreciate it if visudo could be linked to something besides vim. (debian, ubuntu, and sabyon all use nano.)  It's annoying to have to learn the vi editor just for the sake of editing maybe three lines of text.*

*Although I did find my way around this.  I edited the sudoers file with emacs as root, but I kept all the changes commented.  Then i opened visudo, used the delete key to remove the comments (the only key that seems to work in the vi command mode), hit ZZ, and I was good to go! Cool
« Last Edit: August 29, 2007, 09:40:51 am by blackbelt_jones » Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3185



« Reply #1 on: August 29, 2007, 12:50:18 pm »

If what you're looking for is a CLI text editor, we are equipped with mcedit.

Nano is also available in the repositories... just a slapt-get away
Logged

blackbelt_jones
Member
*
Posts: 56


« Reply #2 on: August 29, 2007, 01:12:14 pm »

No, I'm talking about visudo.  No time to explain now, though.
Logged
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #3 on: August 29, 2007, 01:27:13 pm »

blackbelt_jones,

visudo was compiled to only support vi. we use vim for our vi. you can use whatever you like.
just cd to /usr/bin and rm vi and ln -s emacs vi or whatever

HTH,
Uelsk8s
Logged
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #4 on: August 29, 2007, 01:39:22 pm »

If you look in the visudo manual page, there is probably an environment variable such as 'EDITOR' that configures which program should be used.
Logged

"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #5 on: August 29, 2007, 03:09:43 pm »

The EDITOR environment variable does not work here.
visudo ignores it completely.
Logged
blackbelt_jones
Member
*
Posts: 56


« Reply #6 on: August 29, 2007, 04:21:44 pm »

Yeah, I tried that.  Didn't work for me, either.

Like I said, some distros, e.g., Debian, Ubuntu, and Sabyon, do use nano with visudo by default, and I think that would be preferable for the majority of users, which is why I suggested it.

HOWEVER, there may be good reasons for Vector not going that way (obviously, you'd have to make room for nano on the cd,) AND I think I figured out a way around that, which seemed to work for me.   I repeat from my original post:

Quote
I edited the sudoers file with emacs as root, but I kept all the changes commented.  Then i opened visudo, used the delete key to remove the comments (the only key that seems to work in the vi command mode), hit ZZ, and I was good to go!

The way it seems to work is, because of security concerns, you supposedly need to edit the /etc/sudoers file with visudo in order for the edited file to be effective.  However, it appears that you don't need to do ALL the editing in visudo, just the last part of the editing.  It looks like I can do the editing as root with any editor, without visudo, and then simply by opening the file and then resaving it with visudo, visudo gives the file its "blessing".  The file becomes "legal", and the changes take effect.  So, environment variable or not, I can use whatever editor I please, as long as I use visudo afterward.

At least, it seems to have worked this way once-- with my current installation of Vector, when I edited the sudoers file yesterday.  I now have full root access without a password for my normal user account , using sudo.

If the security "key" to visudo is access to the visudo program itself as root, and  such access is necessary to convey the "blessing" of visudo to the edited sudoers file, I don't see that this hack in any way compromises the security that visudo is supposed to  represent.   

If I'm wrong about ANY of this, somebody please tell me.
 
« Last Edit: August 29, 2007, 04:25:51 pm by blackbelt_jones » Logged
saulgoode
Vectorite
***
Posts: 340



« Reply #7 on: August 29, 2007, 11:46:19 pm »

You can permit using the editor specified by the EDITOR environment variable by adding the following line to /etc/sudoers:

Defaults env_editor

However, this is something of a security risk as it allows any program to be executed (without being logged). In order to overcome this, the added line should include the 'editor' parameter followed by a colon-separated list of acceptable editors (full path):

Defaults env_editor,editor=/usr/bin/vi:/usr/bin/nano:/usr/bin/mcedit

If the program specified by the EDITOR environment variable is not in the list, the first program in the list will be used.

As a final note, using visudo with vi/vim/elvis as the editor will perform an integrity check of your sudoers file and warn you if your changes use improper syntax. There is no syntax verification if other editors are specified.
« Last Edit: August 29, 2007, 11:51:11 pm by saulgoode » Logged

A complex system that works is invariably found to have evolved from a simple system that works.
The Headacher
Louder than you
Global Moderator
Vectorian
*****
Posts: 1551


I like the bass to go BOOM!


WWW
« Reply #8 on: August 30, 2007, 01:08:03 am »

Or just use 'su' instead of sudo and leave the sudoers stuff alone.
Logged

Most music on my soundcloud page was arranged in programs running on VL.
blackbelt_jones
Member
*
Posts: 56


« Reply #9 on: August 30, 2007, 07:55:16 am »

Uh, actually.... Embarrassed

I just went back to debian.  So I guess that solves the problem for me. 

Last night, something weird happened when I tried to install a .tlz of vpackager.  Somehow, it screwed up all my torrent downloads...   and I started to think about all those tens of thousands of packages that are available by typing "apt-get install" (sigh) Tongue

Therefore, you may want to take all my suggestions with a grain of salt.  Clearly, I am not Vector material.
Logged
kidd
Packager
Vectorian
****
Posts: 682


« Reply #10 on: August 30, 2007, 08:12:54 am »

Well,
I found you can modify the editor with

Code:
sudo update-alternatives --set editor /usr/bin/notepad.exe

Don't know if it works for VL cause I'm not at my linux box

PS: I see you are really against vi  :p http://www.justlinux.com/forum/showthread.php?threadid=150228

Cheers,
Logged

The Headacher
Louder than you
Global Moderator
Vectorian
*****
Posts: 1551


I like the bass to go BOOM!


WWW
« Reply #11 on: August 30, 2007, 08:17:44 am »

That's a shame. The repositories have come a long way compared to everything before 5.8. Perhaps when vec 6 is released you can have another look, it seems we have more packagers now than ever.

Bye!
Logged

Most music on my soundcloud page was arranged in programs running on VL.
saulgoode
Vectorite
***
Posts: 340



« Reply #12 on: August 30, 2007, 10:13:04 am »

Last night, something weird happened when I tried to install a .tlz of vpackager.  Somehow, it screwed up all my torrent downloads...   and I started to think about all those tens of thousands of packages that are available by typing "apt-get install" (sigh)

I don't wish to start a distro battle, but I would note that Debian has support for over a dozen different architectures while Slackware supports just two. Each architecture needs its own package (other than documentation and source packages) so there is a great deal of redundancy within the Debian repositories (when considered from an x86-only point of view). Also, Debian packaging policy is to split off header files into -dev packages and documentation into -doc packages whereas Slackware guidelines would include the contents of those two additional packages with the main binary.

I have no doubt that there are more projects offering Debian package support than Slackware; but the effective difference is not nearly so great as a simple package count would indicate.
Logged

A complex system that works is invariably found to have evolved from a simple system that works.
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #13 on: August 30, 2007, 10:50:31 am »

I've mentioned that before when people talk about the "huge" package availability difference. Always wondered what a more realistic count would show...
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
blackbelt_jones
Member
*
Posts: 56


« Reply #14 on: August 30, 2007, 12:39:09 pm »

Quote
I don't wish to start a distro battle, but I would note that Debian has support for over a dozen different architectures while Slackware supports just two. Each architecture needs its own package (other than documentation and source packages) so there is a great deal of redundancy within the Debian repositories (when considered from an x86-only point of view). Also, Debian packaging policy is to split off header files into -dev packages and documentation into -doc packages whereas Slackware guidelines would include the contents of those two additional packages with the main binary.

Nothing good ever comes after: "I don't want to start a distro battle, but...",    Isn't it funny how no one ever says, "I want to start a distro battle!"? Cheesy

Well, I don't want to start a distro battle... but listen here, Mr.  Smarty Pants...  Angry

I have recently downloaded the latest stable version of Debian for i386.  That's only for i386, mind you, and it takes up 21 CDs.

http://mirror.yandex.ru/debian-cd/4.0_r1/i386/iso-cd/

Oh, it's a lot of packages!  But it's apt-get that I really  love, an incredibly fast, simple and responsive cli-based package manager. How many irc clients does a fellow need? 

Quote
Do you know how to use apt-get?

sudo apt-get install [package]
apt-cache search [term]
sudo apt-get update (you lists of the repositories)
sudo apt-get uprgrade (your system)
sudo apt-get remove [package]

Well, you do now!


Vector is pretty awesome, especially for its speed, which is phenomenal, probably a little faster than Debian, and I could easily live with Vector out of the box, but I have to go customizing it to death, and that's where it starts to drive me crazy.  The fault is mine, not the OS... but it's the OS that's going to have to go.  You're never going to hear me say an unkind word about Vector.  As a matter of fact, I'm going to be getting another old computer this weekend, just for downloading, and Vector is a strong candidate.  It'll give me an excuse to keep posting in your awesome forum.

« Last Edit: August 30, 2007, 03:11:42 pm by blackbelt_jones » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!