how can i save the changes that i made in jail.local file in fail2ban?
hi i m in jail.local file in fail2ban and when i tried to write the command to save the changes, i am failing. At the bottom there is a word like -- INSERT -- i am trying to write the command instead of that word what should i do
1 Reply
✓ Best Answer
I'm assuming you're trying to do:
sudo vim /some/path/to/jail.local
If you're not using sudo you will not be able to write to the file. The file /some/path/to/jail.local is probably not owned by you.
Consider this vim tutorial:
https://www.tutorialspoint.com/vim/vim_tutorial.pdf
or use nano:
To solve your immediate problem, press:
- i to enter insertion mode at the cursor (insert text before the cursor);
- I to enter insertion mode at the beginning of the line;
- a to enter addition mode at the cursor (add text after the cursor);
- A to enter addition mode at the end of the line; and
- ESC to exit insertion/addition mode.
To navigate in your file (must not be in insertion/addition mode):
- x to delete the character at the cursor;
- dd to delete the line the cursor is on;
- j to move the cursor down a line; and
- k to move the cursor up a line.
If your terminal is configured properly (some variation of xterm or vt100), you can use keyboard cursor keys for navigation.
To save your file and/or exit vim (must not be in insertion/addition mode):
- :w to save the file;
- :w! to overwrite the existing file (ignoring permissions/ownership…provided you can);
- :wq to enter insertion mode at the cursor (insert text before the cursor); and
- :q to quit with prompt about unsaved changes (if any);
- :q! to quit without prompt about unsaved changes (if any);
-- sw