-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux ssh copy id Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to ssh-copy-id on Linux, covering Arch Linux, CachyOS, and other distributions including copying SSH keys to servers, key-based authentication setup, and passwordless login.
Basic usage:
# Copy public key to server
ssh-copy-id user@server
# Copies ~/.ssh/id_rsa.pub to serverUse specific key:
# Use specific key
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
# -i = identity (specific key file)Default public key:
# Copy default key
ssh-copy-id user@server
# Uses ~/.ssh/id_rsa.pub by defaultNon-standard port:
# Custom SSH port
ssh-copy-id -p 2222 user@server
# -p = port (custom SSH port)Test connection:
# After copying key, test connection
ssh user@server
# Should connect without passwordCopy multiple keys:
# Copy different key
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
# Adds key to authorized_keysCheck installation:
# Check ssh-copy-id
which ssh-copy-id
# Install if missing
sudo pacman -S opensshFix permissions:
# On server, fix permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysThis guide covered ssh-copy-id usage, key copying, and passwordless authentication setup for Arch Linux, CachyOS, and other distributions.
- ssh-keygen Guide - Generate keys
- SSH Configuration - SSH setup
- ssh-agent Guide - Key agent
-
ssh-copy-id Documentation:
man ssh-copy-id
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.