> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell/es/powershell-commands/new-rdmsshkey.md).

# New-RDMSSHKey

### Sinopsis

Crear una clave SSH.

### Sintaxis

#### Private

```
New-RDMSSHKey [-Algorithm] <string> -Format <string> [-Comment <string>] [-SavePrivateKey <string>]
 [-Size <int>] [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
```

#### EncryptedPrivate

```
New-RDMSSHKey [-Algorithm] <string> -Format <string> -Passphrase <securestring> [-Comment <string>]
 [-SavePrivateKey <string>] [-Size <int>] [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
```

#### Public

```
New-RDMSSHKey [-Algorithm] <string> [-Comment <string>] [-SavePublicKey <string>] [-Size <int>]
 [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
```

### Descripción

Crear una clave SSH. Se devolverá la clave pública. También existe la posibilidad de guardar un fichero de clave pública o privada. Se puede usar una frase de contraseña para proteger el fichero de clave privada. En ambos casos, un fichero existente será sobrescrito.

### Ejemplos

#### Ejemplo 1

```powershell
PS C:\> $pubKey = New-RDMSSHkey -Algorithm RSA -Comment username@hostname -Size 2048
```

Crear una clave pública SSH de 2048 bits usando RSA y con formato Putty. La clave resultante termina con el comentario (username\@hostname).

#### Ejemplo 2

```powershell
PS C:\> $pubKey = New-RDMSSHkey ECDSA -Comment username@hostname -Size 256 -SavePublicKey C:\mypath\sshPublicKey.pub
```

Crear una clave pública SSH de 256 bits usando ECDSA con el comentario username\@hostname. La clave se guarda en el fichero C:\mypath\sshPublicKey.pub. Si el fichero existe, será sobrescrito.

#### Ejemplo 3

```powershell
PS C:\> $passwd = Read-Host -AsSecureString; $pubKey = New-RDMSSHkey -Algorithm ECDSA -Format PKCS8 -Encryption SHA1_RC4_128 -Size 521 -Round 64 -SavePrivateKey C:\mypath\sshPrivateKey.pri -Passphrase $passwd
```

Primero, la contraseña utilizada para cifrar el fichero se genera a partir de la entrada del usuario. Crear una clave privada SSH de 521 bits usando ECDSA con un comentario vacío. La clave se guarda en el fichero C:\mypath\sshPrivateKey.pri. El formato utilizado es PKCS8 con cifrado SHA1\_RC4\_128 y 64 rondas. Si la frase de contraseña utilizada está vacía, no se producirá ningún cifrado.

#### Ejemplo 4

```powershell
PS C:\> $pubKey = New-RDMSSHkey -Algorithm ECDSA -Comment username@hostname -Format PKCS8 -Size 521 -Round 64 -SavePrivateKey C:\mypath\sshPrivateKey.pri
```

Crear una clave privada SSH de 521 bits usando ECDSA con el comentario username\@hostname. La clave se guarda en el fichero C:\mypath\sshPrivateKey.pri y no está cifrada.

### Parámetros

#### -Algorithm

El algoritmo utilizado para generar la clave SSH.

```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Comment

El comentario al final de una clave pública. No se permiten espacios.

```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -ForcePromptAnswer

Modificador que debe usarse con precaución. Responderá automáticamente a los mensajes que planteen preguntas de sí/no, sí/no/cancelar u ok/cancelar. En caso de varios mensajes, se pueden pasar varios valores a este parámetro. Estos son los valores aceptados:

* Yes: Acepta el mensaje. Cubre los valores OK y Automatic.
* No: Rechaza el mensaje sí/no/cancelar. "Cancel" es la opción alternativa si no existe la opción "No".
* Cancel: Cancela el mensaje sí/no/cancelar. "No" es la opción alternativa si no existe la opción "Cancel".

```yaml
Type: System.Windows.Forms.DialogResult[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Format

El formato utilizado para almacenar la clave privada.

```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Private
  Position: Named
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: EncryptedPrivate
  Position: Named
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Passphrase

Frase de contraseña utilizada para proteger el fichero de clave privada. Se acepta una SecureString vacía, lo que significa que no se producirá ningún cifrado.

```yaml
Type: System.Security.SecureString
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: EncryptedPrivate
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -SavePrivateKey

Guardar la clave privada en un fichero en la ruta especificada. Las extensiones admitidas son: PKCS#1/OpenSSL (*.key), PKCS#8 (*.pri) y PuTTY (\*ppk)

```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Private
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: EncryptedPrivate
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -SavePublicKey

Guardar la clave pública en un fichero en la ruta especificada. La extensión admitida es (\*.pub).

```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Public
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Size

El número de bits de la clave para los algoritmos RSA y ECDSA. Para RSA, el valor predeterminado es 2048 y los valores válidos son: 1024, 2048, 3072, 4096, 6144 y 8192. Para ECDSA, el valor predeterminado es 256 y los valores válidos son: 256, 384 y 521.

```yaml
Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### CommonParameters

Este cmdlet admite los parámetros comunes: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction y -WarningVariable. Para más información, consulte [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Salidas

### Notas

Para más información, escriba "Get-Help New-RDMSSHKey -detailed". Para información técnica, escriba "Get-Help New-RDMSSHKey -full".


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell/es/powershell-commands/new-rdmsshkey.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
