# withUserKeyFile

- Module: [CommunityToolkit.Aspire.Hosting.Sftp](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

Adds a bind mount for the public key file of the specified user to an SFTP container resource.

## Definition

```typescript
interface SftpContainerResource {
  // ... omitted for brevity
  withUserKeyFile(
    username: string,
    keyFile: string,
    keyType: KeyType): SftpContainerResource
}
```

## Parameters

- `username` (`string`)
- `keyFile` (`string`)
- `keyType` ([KeyType](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp/keytype.md))

## Returns

[SftpContainerResource](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp/sftpcontainerresource.md) `builder`

## Applies to

- [SftpContainerResource](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp/sftpcontainerresource.md)
