vi – Error – “E45: ‘readonly’ option is set ( add ! to override)”

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

  1. 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

  1. 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 *

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s