Centos 7 – How to set ” NANO ” default editor for all users

Last updated on August 21st, 2019 at 07:24 am

Install nano

yum install nano -y

Open visudo and add

Defaults editor=/usr/bin/nano

Open nano .bashrc located in /root and edit

export VISUAL=nano

or

export VISUAL=nano; visudo

 

To set it for all users run this command

cat <>~/.bashrc
export VISUAL="nano"
export EDITOR="nano"
EOF