Oftentimes when running and configuring your own server, you will need to edit files. This can be done through SSH by using a text editor. The most common text editors are nano, vi or vim, and emacs.

Common Text Editors

Nano

Nano is the most beginner-friendly text editor available on most Unix-like systems. It's simple, intuitive, and displays keyboard shortcuts at the bottom of the screen.

Basic Nano Commands

Vim/Vi

Vim is a powerful, modal text editor with a steeper learning curve than Nano. It's extremely powerful once you learn it, and is available on virtually all Unix-like systems.

Basic Vim Commands

Emacs

Emacs is another powerful text editor with extensive customization options. It's not as universally available as Nano or Vim, but it's worth knowing about.

How to Choose a Text Editor

Resources for Learning

Nano Resources

Vi/Vim Resources

Emacs Resources

Practical Example

Let's say you need to edit the SSH configuration file on your server. Here's how you would do it with Nano:

  1. Connect to your server via SSH
  2. Run: sudo nano /etc/ssh/sshd_config
  3. Make your changes
  4. Press Ctrl + O to save
  5. Press Enter to confirm the filename
  6. Press Ctrl + X to exit

The same task with Vim would look like:

  1. Connect to your server via SSH
  2. Run: sudo vim /etc/ssh/sshd_config
  3. Press i to enter insert mode
  4. Make your changes
  5. Press Esc to exit insert mode
  6. Type :wq and press Enter to save and exit

Remember that practice makes perfect. The more you use these text editors, the more comfortable you'll become with them.