'[Error writing /filename: Permission denied]' while trying to save a file using the nano editor
Well, you don't have the rights to write that file. Use
sudo nano [filename]
If you're the admin, open another terminal
sudo chmod 777 <filename>
<password>
go back to your "nano" terminal save the file. Change permissions back on the filename if you care, they wee most likely 755
I got your problem and to resolve this error there is a easy way, so basically you need to do nothing but switch from normal user to root user and for that type the command sudo su then enter
Now you have full access, so do whatever you want to do because now you have super user's power.
su means switch user
To create file in nano text editor simply type :- nano [file name] then enter and now can you use all features of nano without any interruption.
There you go, I hope this would be helpful