🔒

Remote Server Administration with SSH and FTP

Oct 10, 2024

SSH and FTP for Remote Administration

Overview

  • Topic: SSH (Secure Shell) and FTP (File Transfer Protocol)
  • Purpose: Enable remote administration of Linux servers without physical access.

SSH (Secure Shell)

Definition

  • SSH allows remote command line access to a server through a terminal emulator.

Requirements

  • Installation: SSH server must be installed on the Linux server.
    • Command: sudo apt-get install ssh
  • Firewall Configuration: Ensure that port 22 (default for SSH) is open.
    • Command to check UFW status: sudo ufw status

Usage

  1. Terminal Emulator: Use a terminal emulator (e.g., PuTTY, iPhone apps) for connection.
  2. Connection Process:
    • Enter the server's IP address (e.g., 10.1.10.12).
    • Log in with username and password.
  3. Commands: Execute any command as if directly in front of the server.
    • Example Commands: top, apt-get, cd, mkdir, ls

FTP (File Transfer Protocol)

Definition

  • FTP is used for uploading and downloading files to/from the server.

Requirements

  • Installation: Install VSFTPD (Very Secure FTP Daemon).
    • Command: sudo apt-get install vsftpd
  • Configuration: Edit the configuration file to enable uploads and local user access.
    • Configuration file: /etc/vsftpd.conf
    • Key settings to uncomment:
      • local_enable=YES (allows local users to log in)
      • write_enable=YES (allows users to upload files)
  • Restart Service: After making changes, restart the FTP service.
    • Command: sudo service vsftpd restart

FTP Client Connection

  • Use any FTP client (e.g., FileZilla, Qt FTP) to access the server.
  • Connection Steps:
    1. Enter the server IP address and user credentials.
    2. Navigate directories to upload/download files.

Security Considerations

  • Create user accounts for specific access to restrict directories (e.g., set an employee's home directory to /var/www for web server access).
  • Ensure appropriate firewall rules are in place to open necessary ports (e.g., port 22 for SSH, port 21 for FTP).

Summary

  • SSH: Install using sudo apt-get install ssh, ensure port 22 is open, and use a terminal emulator.
  • FTP: Install using sudo apt-get install vsftpd, configure access in /etc/vsftpd.conf, and use any FTP client to connect.

Conclusion

  • Understanding SSH and FTP is crucial for effective remote server administration.
  • SSH is for command line access, while FTP is for file management.