Iirc, nano is the default editor. Pretty sure you can change it with update-alternatives to the editor of your choice.
I have only used visudo to edit the /etc/sudoers file. For editing most other files, sudo emacs or sudo vi or sudo ed should work just fine. man visudo summaries itself as "visudo — edit the sudoers file" See also "man update-alternatives" On Mon, Oct 4, 2021 at 1:17 AM Keith Lofstrom <kei...@kl-ic.com> wrote: > > I am learning about Ubuntu sysadmin, and why I should use > visudo instead of logging in as root user to use vi. > This assumes that Eve hasn't inserted a malware version > of visudo into my path ... > > Except - on Ubuntu 18.04 LTS, visudo calls the "nano" > text editor, and on 20.04 LTS it calls the "joe" text > editor. So WHY still call it visudo? > > Anyway, I will use vi (aka vim) until they pry my keyboard > out of my cold dead fingers. I change editors as often as > I change lungs. > > Other helpful guest sysadmins may prefer this shifting > editor nonsense, so I plan to leave /usr/bin/visudo as-is > and create a /usr/local/sbin/vvisudo shell script > containing "sudo EDITOR=vim visudo" ... > > ... and add Yet Another Postit with how to exit nano > or joe, or whatever editor they eventually choose for > 22.04 LTS, in case I forget the extra v for vvisudo. > > Keith > > P.S. Ctl-x for nano, Ctl-k for joe. I think ... > > P.P.S. vi turns fifty in 2026. I've used it since it > was beta. Others change editors more often than they > change their underwear. > > -- > Keith Lofstrom kei...@keithl.com