nano is a commandline text editor. Save with CTRL-O and exit with CTRL-X.
This will only work if you have write access to this file in the /etc subdirectory , i.e. have properly become "root" beforehand.
That is why you need to type "sudo nano ...."