ftpusers - Linux


Overview

ftpusers is a versatile utility designed to manage and inspect FTP (File Transfer Protocol) user listings. It provides a comprehensive set of options to filter, search, and perform various operations on FTP user records.

Syntax

ftpusers [-hV] [-a | -A] [-e] [-f pattern] [-g group] [-l] [-s state] [-u user]

Options/Flags

  • -h, –help: Displays help information.
  • -V, –version: Displays version information.
  • -a, –all: Fetches all user listings, including those not accessible to the current user.
  • -A, –available: Lists only users not already authenticated.
  • -e, –email: Displays email addresses for users.
  • -f, –filter pattern: Filters user listings by matching against a given pattern.
  • -g, –group group: Filters user listings by group membership.
  • -l, –long: Displays detailed information for each user, including user ID, group ID, home directory, and shell.
  • -s, –state state: Filters user listings by FTP connection status (e.g., connected, idle, anonymous).
  • -u, –user user: Filters user listings by username.

Examples

Display a list of all FTP users:

ftpusers

Filter users by username:

ftpusers -u username

Search for users with a particular email address:

ftpusers -e -f "*@example.com"

List only connected users:

ftpusers -s connected

Extract group names for each user:

ftpusers -g | cut -d':' -f 2

Common Issues

  • Permission denied: Ensure you have sufficient permissions to access FTP user listings. Consider using the -a flag.

Integration

Combine with grep to filter results:

ftpusers -A | grep "anonymous"

Use with awk to extract specific fields:

ftpusers -l | awk '{print $1, " (" $3 ")"}'

Related Commands

  • ftpd
  • ftp
  • netstat