> 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/it/powershell-commands/new-rdmsshkey.md).

# New-RDMSSHKey

### Sinossi

Crea una chiave SSH.

### Sintassi

#### 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>]
```

### Descrizione

Crea una chiave SSH. Verrà restituita la chiave pubblica. È inoltre possibile salvare un file di chiave pubblica o privata. È possibile utilizzare una passphrase per proteggere il file della chiave privata. In entrambi i casi, un file esistente verrà sovrascritto.

### Esempi

#### Esempio 1

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

Crea una chiave pubblica SSH di 2048 bit utilizzando RSA e con formato Putty. La chiave risultante termina con il commento (username\@hostname).

#### Esempio 2

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

Crea una chiave pubblica SSH di 256 bit utilizzando ECDSA con il commento username\@hostname. La chiave viene salvata nel file C:\mypath\sshPublicKey.pub. Se il file esiste, verrà sovrascritto.

#### Esempio 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
```

Innanzitutto, la password utilizzata per crittografare il file viene generata dall'input dell'utente. Crea una chiave privata SSH di 521 bit utilizzando ECDSA con un commento vuoto. La chiave viene salvata nel file C:\mypath\sshPrivateKey.pri. Il formato utilizzato è PKCS8 con crittografia SHA1\_RC4\_128 e 64 round. Se la passphrase utilizzata è vuota, non verrà applicata alcuna crittografia.

#### Esempio 4

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

Crea una chiave privata SSH di 521 bit utilizzando ECDSA con il commento username\@hostname. La chiave viene salvata nel file C:\mypath\sshPrivateKey.pri e non è crittografata.

### Parametri

#### -Algorithm

L'algoritmo utilizzato per generare la chiave 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

Il commento alla fine di una chiave pubblica. Non sono ammessi spazi.

```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

Opzione da utilizzare con cautela. Risponderà automaticamente ai prompt che pongono domande sì/no, sì/no/annulla oppure ok/annulla. In caso di più prompt, è possibile passare più valori a questo parametro. Ecco i valori accettati:

* Yes: accetta il prompt. Copre i valori OK e Automatic.
* No: rifiuta il prompt sì/no/annulla. "Cancel" è l'opzione di ripiego se non è presente l'opzione "No".
* Cancel: annulla il prompt sì/no/annulla. "No" è l'opzione di ripiego se non è presente l'opzione "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

Il formato utilizzato per archiviare la chiave privata.

```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

Passphrase utilizzata per proteggere il file della chiave privata. È accettata una SecureString vuota, il che significa che non verrà applicata alcuna crittografia.

```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

Salva la chiave privata in un file nel percorso specificato. Le estensioni supportate sono: PKCS#1/OpenSSL (*.key), PKCS#8 (*.pri) e 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

Salva la chiave pubblica in un file nel percorso specificato. L'estensione supportata è (\*.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

Il numero di bit della chiave per gli algoritmi RSA ed ECDSA. Per RSA, il valore predefinito è 2048 e i valori validi sono: 1024, 2048, 3072, 4096, 6144 e 8192. Per ECDSA, il valore predefinito è 256 e i valori validi sono: 256, 384 e 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

Questo cmdlet supporta i parametri comuni: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction e -WarningVariable. Per maggiori informazioni, consulti [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Output

### Note

Per maggiori informazioni, digiti "Get-Help New-RDMSSHKey -detailed". Per informazioni tecniche, digiti "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/it/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.
