Background
Trying to save a file in vi, but “No Go“.
Error Number
Error Image
Error Text
E45: ‘readonly’ option is set (add ! to override)
Troubleshooting
Outline
- File Info
- ls
File Info
ls
Syntax
ls [file]
Sample
ls [file]
Output
Output – Image
Output – Text
>ls -la total 20 drwxr-xr-x. 2 root root 115 Nov 24 16:47 . drwxrwxr-x. 4 daniel daniel 68 Nov 24 16:48 .. -rw-rw-r--. 1 root root 3147 Nov 24 16:30 datafileWriteRandom.sh -rw-rw-r--. 1 root root 3147 Nov 24 16:30 datafileWriteRandom.sh.txt -rw-rw-r--. 1 root root 5239 Nov 24 13:38 literature.txt -rw-rw-r--. 1 root root 749 Nov 23 14:37 readDatafile.sh
Explanation
From issuing ls, we can see that our file’s owner is the root user.
Remediation
Outline
- Folder and File Owner
- chown
- chgrp
Folder & File Ownership
chown
Syntax
chown [file]
Sample
sudo chown .
Output
Output – Image
Explanation
We changed the files owner
chgrp
Syntax
chgrp [file]
Sample
sudo chgrp *