You are not logged in.

#1 2012-09-16 13:54:57

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

[SOLVED] Can't edit anything in visudo

Hi!

I try to edit the /etc/sudoers file, so i type in the command:

visudo

And i get the file opened via vi, which is by the way the crappiest
text editor i have ever encountered. I cant even add in the line:

ziga ALL=(ALL) ALL

Thats all i want to do and i can't do it as vi oviously has problems
with synchronisation or what the ****. My keyboard doesn't even listen
to me. This are the problems i encounter:

1st)   When i press enter sometimes i get the new line and sometimes i don't
2nd)  I can't insert capital letters like in "ADD" as nothing is written in file when i press
         a combination of keyboard keys "SHIFT + A", i get "a".
3rd)  I can't produce a ")" as it is the same as with capital letters. I get notthing when i
        press key combination SHIFT + 9.

Last edited by 71GA (2012-09-16 14:56:01)


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#2 2012-09-16 14:06:12

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [SOLVED] Can't edit anything in visudo

Maybe nano would be easier for you to use.

# EDITOR=/usr/bin/nano visudo

Just because you don't know how to use it, doesn't make vi crappy btw.

Last edited by WorMzy (2012-09-16 14:08:03)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2012-09-16 14:08:24

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] Can't edit anything in visudo

I already used nano but Arch Wiki explicitly sugests to use vi.

WorMzy wrote:

Just because you don't know how to use it, doesn't make vi crappy btw.

I can't agree with that as good program is allways intuitive. And vi is not.


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#4 2012-09-16 14:11:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Can't edit anything in visudo

71GA wrote:

good program is allways intuitive. And vi is not.

OT: I don't need an intuitive (easy to use) app, I need a fast one. That's why I use vim.

Offline

#5 2012-09-16 14:17:39

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [SOLVED] Can't edit anything in visudo

71GA wrote:

I already used nano but Arch Wiki explicitly sugests to use vi.

Even if it does, that should only be interpreted as a suggestion. The internet police won't come and arrest you because you don't use a specific editor.

Seriously, just use what feels easiest for you. If you want to learn how to use vi though, I suggest installing vim, and running the "vimtutor" program. The stuff in that tutorial will help you understand the basics on how to use both vi and vim.

Last edited by WorMzy (2012-09-16 14:18:15)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#6 2012-09-16 14:23:24

ixnine
Member
Registered: 2008-11-01
Posts: 60

Re: [SOLVED] Can't edit anything in visudo

# pacman -Rcunss vi

Offline

#7 2012-09-16 14:31:34

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: [SOLVED] Can't edit anything in visudo

I don't understand vi or vim so just use nano instead.

EDITOR=nano visudo

You can also define a default editor in your bashrc

export EDITOR=/usr/bin/nano

and then use

sudo -E visudo

Rauchen verboten

Offline

#8 2012-09-16 14:35:48

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [SOLVED] Can't edit anything in visudo

SS4 wrote:

I don't understand vi or vim so just use nano instead.

EDITOR=nano visudo

You can also define a default editor in your bashrc

export EDITOR=/usr/bin/nano

and then use

sudo -E visudo

In addition to this, you can also specify an editor in the sudoers Defaults.

From man sudoers:

     editor            A colon (‘:’) separated list of editors allowed to be
                       used with visudo.  visudo will choose the editor that
                       matches the user's EDITOR environment variable if pos‐
                       sible, or the first editor in the list that exists and
                       is executable.  The default is /usr/bin/vi.

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#9 2012-09-16 14:47:03

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] Can't edit anything in visudo

Thank you all!

Maybe vi is fast, but it doesnt suit me. I appologize if i accidently insulted anyone but i am a noob please forgive me.
I'll just reconfigure nano to be my default editor.

Cheers


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#10 2012-09-16 14:50:19

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Can't edit anything in visudo

I don't think there's any need to export it. Run:

$ sudo EDITOR=nano visudo

Add this to the first line:

Defaults editor=/usr/bin/nano

Now you can just run:

$ sudo visudo

Problem solved.


This is how I keep it, by the way. wink

Last edited by DSpider (2012-09-16 14:51:10)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB