You can stop or start an SFTP server to manage its state, control access, and help optimize costs.
Stopping a server disables access and reduces resource usage. For example, if you suspect unauthorized access to a server, you can halt all active transfers and block new connections by stopping the server. As another example, you can reduce server uptime costs by pausing a server during periods when no data transfers are expected.
When you start a server, access is restored and users can connect to the server.
Required roles
To get the permission that
you need to start or stop an SFTP server,
ask your administrator to grant you the
Cloud FTP Admin (roles/ftp.admin) IAM role on your project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the
ftp.servers.update
permission,
which is required to
start or stop an SFTP server.
You might also be able to get this permission with custom roles or other predefined roles.
Stop a server
When you stop a server, the following things happen:
Access is denied and active connections are dropped. Users who have an active connection might see an error message like the following:
Connection is terminated: Connection closed by remote host client_loop: send disconnect: Broken pipe Connection closedNo new connections can be established.
To stop a server, use the following steps.
REST
To stop a server, use the
servers.stop method.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID of the server.
- LOCATION_ID: the Google Cloud location of
the server, such as
us-west1. - SERVER_ID: the server ID.
HTTP method and URL:
POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:stop
To send your request, expand one of these options:
The response identifies a long-running operation.Start a server
REST
To start a server, use the
servers.start method.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID of the server.
- LOCATION_ID: the Google Cloud location of
the server, such as
us-west1. - SERVER_ID: the server ID.
HTTP method and URL:
POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:start
To send your request, expand one of these options:
The response identifies a long-running operation. It takes a few minutes for the server to start.