Get SFTP user information

This document shows how to get information about your Cloud FTP users. You can list all users for a server. You can also get detailed information about a specific user, such as the user's Cloud Storage directory mappings and permissions.

Required roles

To get the permissions that you need to get information about SFTP users, ask your administrator to grant you the Cloud FTP Viewer (roles/ftp.viewer) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to get information about SFTP users. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to get information about SFTP users:

  • List users: ftp.users.list
  • Get user details: ftp.users.get

You might also be able to get these permissions with custom roles or other predefined roles.

List users

gcloud

To list SFTP users for a server, run the gcloud alpha storage ftp users list command.

Before using any of the command data below, make the following replacements:

  • LOCATION_ID: the location of the server, such as us-west1.
  • SERVER_ID: the server ID.

Execute the following command:

Linux, macOS, or Cloud Shell

gcloudalphastorageftpuserslist--location=LOCATION_ID--server=SERVER_ID

Windows (PowerShell)

gcloudalphastorageftpuserslist--location=LOCATION_ID--server=SERVER_ID

Windows (cmd.exe)

gcloudalphastorageftpuserslist--location=LOCATION_ID--server=SERVER_ID

REST

To list SFTP users for a server, use the servers.users.list method.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the Google Cloud project ID.
  • LOCATION_ID: the location of the server, such as us-west1.
  • SERVER_ID: the server ID.

HTTP method and URL:

GET https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID/users

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID/users"

PowerShell (Windows)

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID/users" | Select-Object -Expand Content

The response body is a JSON object with a list of User resources.

Get details about a user

To get detailed information about a specific user, such as the user's Cloud Storage directory mappings and permissions, the email address of the service account that accesses Cloud Storage resources on behalf of the user, and the user's credentials, use the following steps.

gcloud

To get details about an SFTP user, run the gcloud alpha storage ftp users describe command.

Before using any of the command data below, make the following replacements:

  • USERNAME: the SFTP user's username.
  • LOCATION_ID: the location of the server, such as us-west1.
  • SERVER_ID: the SFTP server ID.

Execute the following command:

Linux, macOS, or Cloud Shell

gcloudalphastorageftpusersdescribeUSERNAME--location=LOCATION_ID\
--server=SERVER_ID

Windows (PowerShell)

gcloudalphastorageftpusersdescribeUSERNAME--location=LOCATION_ID`
--server=SERVER_ID

Windows (cmd.exe)

gcloudalphastorageftpusersdescribeUSERNAME--location=LOCATION_ID^
--server=SERVER_ID

REST

To get details about an SFTP user, use the servers.users.get method.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the Google Cloud project ID.
  • LOCATION_ID: the location of the server, such as us-west1.
  • SERVER_ID: the SFTP server ID.
  • USERNAME: the SFTP user's username.

HTTP method and URL:

GET https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID/users/USERNAME

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID/users/USERNAME"

PowerShell (Windows)

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID/users/USERNAME" | Select-Object -Expand Content

The response body is a User resource.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年08月26日 UTC.