Barrack API Documentation
  1. ssh
Barrack API Documentation
  • Platform Documentation
    • "Authentication & Access"
    • "Getting Started"
    • "Platform Documentation"
    • "Troubleshooting"
    • vm
      • "Advanced Configuration"
      • "Boot Source Configuration"
      • "GPU Configuration"
      • "Region Selection"
      • "SSH Key Configuration"
      • "VM States & Billing"
    • storage
      • "Managing Volumes"
      • "Storage Management"
    • ssh
      • "Creating SSH Keys"
      • "Importing SSH Keys"
      • "Managing SSH Keys"
    • security
      • "Attaching Firewalls to VMs"
      • "Firewall Management"
      • "Firewall Rules"
    • dashboard
      • "Dashboard Overview"
      • "VM Management"
    • backup
      • "Creating Snapshots"
      • "Custom Images"
      • "Managing Snapshots"
      • "Restoring Snapshots"
      • "Snapshots Management"
    • account
      • "Credits System"
      • "Account Management"
  • Balance
    • Get credit balance
      GET
  • GPU Stocks
    • Get GPU stock availability
      GET
  • GPU Specs
    • Get GPU specifications
      GET
  • Regions
    • List available regions
      GET
  • Pricing
    • Get pricing information
      GET
    • Get pricing information
      POST
  • Deploy Instance
    • Create a new instance
      POST
  • Instance management
    • List instances
      GET
    • Delete instance
      DELETE
    • Get instance billing
      GET
    • Hibernate instance
      POST
    • Reboot instance
      POST
    • Restore hibernated instance
      POST
    • Start instance
      POST
    • Stop instance
      POST
    • Toggle public IP for instance
      POST
    • Get instance details
      GET
    • Get hibernated instances count
      GET
    • Add instance security rule
      POST
    • Remove instance security rule
      DELETE
  • OS Images
    • List OS images
  • SSH Keys
    • List SSH keys
    • Create SSH key
    • Get SSH key
    • Delete SSH key
  • Scripts
    • List all startup scripts
    • Create a startup script
    • Get startup script details
    • Update a startup script
    • Delete a startup script
    • Delete multiple startup scripts
  • Firewalls
    • List firewalls
    • Get firewall details
    • Attach firewall to instances
    • Get firewalls attached to instance
    • Delete firewall
    • Remove firewall rule
    • Add firewall rule
    • Create firewall
    • Get supported protocols
    • List instances available for firewall attachment
    • List instances available for firewall attachment
  • Snapshots
    • List snapshots
    • Get snapshot billing
    • List Instance eligible for snapshot creation
    • Get snapshot details
    • Delete snapshot
    • Restore snapshot
    • Create snapshot
    • Create snapshot
    • Get snapshot billing
  • Images
    • List custom images
    • Get image details
    • Delete custom image
    • Create image from snapshot
    • Get snapshot-image relationship
    • Get snapshot-image relationship list
  • AI Chat
    • Chat with AI
    • Get AI usage summary
    • Get AI usage history
    • Get available AI models
  • Volumes
    • Attach volumes to instance
    • Detach volumes from instance
    • Clone volume
    • Resize volume
    • Get volume billing
    • List available volume types
    • List volumes
    • Create volume
    • Get volume details
    • Delete volume
  • Virtual Machines
    • Get firewalls attached to instance
    • Remove instance security rule
    • List Instance eligible for snapshot creation
  • Schemas
    • AITransaction
    • AddFirewallRuleRequest
    • AddFirewallRuleResponse
    • AddVMSecurityRuleResponse
    • AttachFirewallRequest
    • AggregatedBillingResponse
    • AttachFirewallResponse
    • AttachVolumesRequest
    • AttachVolumesResponse
    • AttachedFirewall
    • BatchSnapshotImageRelationshipResponse
    • Balance
    • Billing
    • ChatCompletionsRequest
    • ChatCompletionsResponse
    • CloneVolumeRequest
    • BillingRecord
    • CloneVolumeResponse
    • BillingSummary
    • CreateFirewallRequest
    • CreateFirewallResponse
    • CreateImageFromSnapshotRequest
    • CreateSSHKeyRequest
    • CreateScriptRequest
    • CreateSnapshotRequest
    • CreateSnapshotResponse
    • CreateSSHKeyResponse
    • CurrencyEnum
    • Data
    • CreditBalanceResponse
    • DeleteFirewallResponse
    • CreateVolumeRequest
    • DeleteSnapshotResponse
    • CreateVolumeResponse
    • DeleteVMResponse
    • DetachVolumesRequest
    • DetachVolumesResponse
    • DeploymentRequest
    • DirectionEnum
    • DeploymentResponse
    • EthertypeEnum
    • ErrorResponse
    • FirewallAttachment
    • DeleteVolumeResponse
    • DeleteSSHKeyResponse
    • FirewallEnvironment
    • FirewallResponse
    • FirewallRule
    • FirewallVM
    • GetBatchSnapshotImageRelationshipsRequest
    • GetFirewallDetailsResponse
    • GPUStockConfiguration
    • GPUSpec
    • GetHibernatedVMsResponse
    • GPUStockItem
    • GPUSpecsResponse
    • GetSupportedProtocolsResponse
    • GPUStocksResponse
    • GetVMAttachedFirewallsResponse
    • GetVolumeTypesResponse
    • HibernateVMResponse
    • HibernationBillingMetrics
    • ListFirewallsResponse
    • ListUserVMsResponse
    • ListVMsResponse
    • ModelsResponse
    • GetSSHKeysResponse
    • Pagination
    • PricingRequest
    • OSImage
    • PricingResponse
    • OSImagesResponse
    • Protocol
    • GpuCountEnum
    • ProtocolEnum
    • Image
    • GpuModelEnum
    • GetVolumeDetailsResponse
    • RebootVMResponse
    • ImageCreateResponse
    • RecentHibernation
    • ImageDeleteResponse
    • GetVolumesWithNextNameResponse
    • RemoveFirewallRuleResponse
    • ImageDetailResponse
    • RemoveVMSecurityRuleResponse
    • Region
    • ImageListResponse
    • ResizeVolumeRequest
    • RegionsResponse
    • Price
    • ResizeVolumeResponse
    • ResourceTypeEnum
    • RestoreSnapshotRequest
    • RestoreSnapshotResponse
    • RestoreVMResponse
    • Snapshot
    • SnapshotImageRelationshipResponse
    • Specs
    • StartVMResponse
    • StopVMResponse
    • TierEnum
    • UpdateScriptRequest
    • UsageHistoryResponse
    • UsageSummaryResponse
    • RegionEnum
    • UserVM
    • VMDetailsResponse
    • VMFlavor
    • VMImage
    • VMInstance
    • VMResponse
    • SpecsMetadata
    • VMSecurityRule
    • VMSecurityRuleRequest
    • VMStatus
    • VMVolumeAttachment
    • Script
    • VolumeTypeEnum
    • SSHKeyResponse
    • ScriptListResponse
    • ToggleVMPublicIPResponse
    • VolumeBillingRecord
    • VolumeBillingSummary
    • VolumeHourlyBillingResponse
    • VolumeResponse
  1. ssh

"Importing SSH Keys"

If you already have SSH keys that you use for other services (GitHub, GitLab, other cloud providers), you can import the public key to use with your virtual machines on our platform.
To import an existing SSH public key:
1
Navigate to SSH Keys
Navigate to the SSH Keys page from the sidebar
2
Initiate Import
Click "Import Key" button
3
Name Your Key
Enter a descriptive name for the key (maximum 50 characters):
Names must contain only letters, numbers, underscores, hyphens, and periods
Use descriptive names like "github-key" or "laptop-ssh-key"
Choose names that identify the key's source or purpose
4
Paste Public Key
Paste your public key content in the text area:
Key must begin with ssh-rsa, ssh-ed25519, or similar
Include the entire public key on a single line
Include optional comment if desired
5
Import Key
Click "Import Key" to add it to your account:
System validates key format automatically
Key is added to your account immediately
Available for VM deployment right away

Finding Your Public Key#

Locate your existing public key on your system:
Linux/MacOS
Windows
Common Public Key Locations
Your public key is typically located at:
Display and copy your public key:

Public Key Format Requirements#

Understanding the correct format for import:

Valid Key Formats#

Format Validation#

Supported Key Types#

The platform supports industry-standard SSH key types:
RSA Keys
Ed25519 Keys
ECDSA Keys
RSA Key Support
Format: ssh-rsa
Recommended Size: 2048+ bits (4096 bits preferred)
Compatibility: Universal compatibility with all SSH clients
Security: Mature, well-tested algorithm
Use Case: Most common, works everywhere

Importing from Popular Services#

GitHub SSH Keys#

1
Access GitHub SSH Keys
Go to GitHub → Settings → SSH and GPG keys
2
Copy Public Key
Copy the public key content from GitHub
3
Import to Platform
Paste the key in the import dialog
4
Use Descriptive Name
Name it something like "github-personal-key"

GitLab SSH Keys#

1
Access GitLab SSH Keys
Go to GitLab → User Settings → SSH Keys
2
Copy Public Key
Copy the public key content from GitLab
3
Import to Platform
Paste the key in the import dialog
4
Use Descriptive Name
Name it something like "gitlab-work-key"

Import Validation and Errors#

Common Import Issues#

Format Errors
Key Type Issues
Duplicate Keys
Name Conflicts

Best Practices for Key Import#

Key Selection#

Choose Strong Keys
Security Considerations
Prefer Ed25519 keys for new imports
Use RSA keys with 2048+ bits minimum
Avoid old or deprecated key formats
Verify key source and integrity
Organize by Purpose
Key Organization
Import separate keys for different purposes
Use descriptive names indicating source/purpose
Group related keys with consistent naming
Document key purposes for team usage

Naming Strategy#

1
Identify Source
Include the source service or system in the name
2
Specify Purpose
Indicate what the key will be used for
3
Add Context
Include environment or project information
4
Use Consistent Format
Develop naming convention for consistency
Example naming patterns:
github-personal-2024
gitlab-work-project-alpha
laptop-development-key
ci-cd-deployment-key

Security Considerations#

Key Reuse Benefits#

Simplified Management
Proven Security

Security Precautions#

Troubleshooting Import Issues#

Validation Problems#

Format Issues
Copy-Paste Issues
Key Format Problems
Common Problems:
Line breaks in the middle of key
Missing key type prefix
Extra whitespace or characters
Truncated or incomplete key
Solutions:
Copy key again from original source
Verify entire key is selected
Check for line wrapping issues
Use text editor to verify format

Testing Imported Keys#

1
Verify Import Success
Check that key appears in SSH keys list
2
Test with VM Deployment
Use imported key for new VM deployment
3
Test SSH Connection
Connect to VM using imported key
4
Validate Functionality
Confirm normal SSH operations work correctly

Import vs. Creation Comparison#

When to Import
When to Create New
Import Existing Keys When:
You already have secure, trusted keys
You want consistent access across platforms
You have established key management procedures
You're migrating from another platform
Previous
"Creating SSH Keys"
Next
"Managing SSH Keys"
Built with