Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk9 min

Basic SSH Commands Every VPS Owner Should Know

A practical guide to the SSH commands VPS owners use most, with exact port options, key-login setup, scp and rsync examples, troubleshooting, and safe sshd hardening.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A small set of OpenSSH commands covers most VPS administration: ssh for sessions, ssh-keygen for keys, ssh-copy-id for installing a public key, scp and rsync for transfers, and ssh -v plus ssh-keygen -R for common connection problems. Learn them in that order, confirm key access in a second session, and only then change the server’s authentication policy.

What you need before running an SSH command

SSH is the encrypted management channel between your local computer and a service running on the VPS. You need the server’s public IP address or DNS name, a login username, and the SSH port. Port 22 is common, but a provider or administrator may have chosen another port. You also need a local terminal: Terminal on macOS or Linux, or PowerShell, Windows Terminal, or another OpenSSH client on Windows.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The examples use user@host. Replace user with the account that should log in and host with the VPS address. Do not assume that the account is root; many images create a regular administrative user instead. A command that succeeds for one account can fail for another because home directories and authorized_keys files are separate.

Connect to a VPS with ssh

Standard port

Start a session with:

ssh user@host

On the first connection, the client shows the server’s host-key fingerprint and asks whether to continue. Verify that fingerprint through a trusted channel supplied by your VPS provider or administrator before accepting it. Once accepted, the key is stored in your local known_hosts file, allowing the client to detect a later key change.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Non-standard port

Specify a different SSH port with a lowercase -p:

ssh -p 2222 user@host

The lowercase option is easy to confuse with scp‘s port option; the distinction matters when copying files. If the port is wrong, the client normally waits and then reports a timeout or connection refusal, so check the port in the VPS control panel and any firewall policy before changing credentials.

What a successful login looks like

You should receive a shell prompt for the remote account. Run a harmless command such as whoami to confirm which account you reached, then hostname if you need to distinguish among several servers. End the session with exit or by pressing Ctrl-D. Keep this working session open while changing SSH configuration later.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create an SSH key pair with ssh-keygen

Ed25519: the usual modern choice

Generate the pair on your local computer, not inside the VPS:

ssh-keygen -t ed25519 -C "[email protected]"

The command asks where to save the private key and whether to protect it with a passphrase. Accepting the suggested location is convenient when you have no existing key, but choose a different filename if you already use that path. The private key must remain on your computer and should not be pasted into a server, ticket, or chat. The matching public key has the same base name with a .pub suffix and is the one that can be installed on the VPS.

Ed25519 is generally the preferred modern format because it is fast and provides strong security with a compact key. A passphrase protects the private key if the file is copied; you will be prompted for it when the key is used unless your local SSH setup caches the unlocked key.

RSA for older systems

If the target operating system or embedded SSH implementation cannot use Ed25519, create a 4096-bit RSA key instead:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
ssh-keygen -t rsa -b 4096

RSA has wider legacy compatibility, while Ed25519 is the sensible default for current OpenSSH installations. Do not overwrite an existing key until you know which services depend on it.

Install your public key with ssh-copy-id

Default port

After creating a key, copy the public half to the account’s SSH directory:

ssh-copy-id user@host

You will authenticate with the account’s current password. The utility appends your public key to that user’s authorized_keys file, so subsequent logins can use the private key instead of a password. Test the result in a new terminal before closing the original password-authenticated session:

ssh user@host

Non-standard port

ssh-copy-id uses lowercase -p, just like ssh:

ssh-copy-id -p 2222 user@host

A common mistake is using uppercase -P here; that option belongs to scp and will not correctly specify the port for ssh-copy-id.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When ssh-copy-id is unavailable

The command is not bundled with Windows PowerShell. You can still install a key manually if password login works:

  1. Display your public key locally, for example with type $env:USERPROFILE.sshid_ed25519.pub in PowerShell, and copy the entire single line.
  2. Log in with ssh user@host.
  3. Create the SSH directory and restrict its permissions: mkdir -p ~/.ssh followed by chmod 700 ~/.ssh on a Unix-like VPS.
  4. Append the copied line to ~/.ssh/authorized_keys and run chmod 600 ~/.ssh/authorized_keys.
  5. Open a second terminal and test key login before altering server authentication settings.

The manual method assumes a Unix-like server and a shell account with permission to modify its home directory. If the server uses a different account or home path, place the key in that account’s actual authorized_keys file.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Copy individual files with scp

Upload a file

Send a local file to a directory on the VPS with:

scp file user@host:/path

For example, the destination can be an application directory or your remote home directory. The remote account must have write permission there.

Download a file

Reverse the source and destination to download:

scp user@host:/path/file .

The dot means the current local directory. Replace it with an explicit local path when you want the file stored elsewhere.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Copy a directory recursively

Use uppercase -r for a directory tree:

scp -r dir user@host:/path

This is convenient for a one-time copy, but it does not maintain a change history or send only modified files on later runs.

Use a custom port

scp uses uppercase -P:

scp -P 2222 file user@host:/path

Remember the option contrast: ssh and ssh-copy-id use lowercase -p; scp uses uppercase -P. If you omit the option, scp attempts the default SSH port.

Synchronize folders with rsync over SSH

For repeated deployments, backups, or large directory trees, rsync avoids retransmitting files that have not changed. This command tells it to use SSH as the transport:

rsync -avz -e ssh src/ host:dst/

The archive option preserves common file attributes while traversing directories, -v prints activity, and -z compresses data during transfer. Replace src/ with the local source and host:dst/ with the remote account and destination. The command is incremental: after the first run, only detected changes are sent.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Preview changes first

Add n to make a dry run:

rsync -avzn -e ssh src/ host:dst/

Review the listed additions, updates, and removals before performing the real synchronization. A dry run is especially important when the source and destination paths are generated by scripts.

Understand the danger of –delete

--delete removes files in the destination that are absent from the source:

rsync -avzn --delete -e ssh src/ host:dst/

Use the dry-run form first, confirm that the destination is correct, and only then remove n for the live operation. A mistyped destination combined with --delete can erase unrelated remote files. Keep independent backups when the destination contains data that is not reproducible from the source.

Diagnose failed connections with verbose SSH output

When a connection fails, add -v:

ssh -v user@host

The client prints negotiation and authentication details. Look for the stage at which it stops: name resolution, TCP connection, host-key verification, authentication method selection, or account authorization. This distinction helps you choose the right fix:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • A name-resolution error points to an incorrect hostname or DNS record.
  • A timeout or refusal usually means the address, port, firewall, or SSH service is wrong.
  • A host-key warning concerns server identity, not the account password.
  • An authentication failure means the offered key, password, username, or server policy did not match.

Do not paste private keys or passphrases into a support request. Verbose output can contain usernames, hostnames, and configuration details, so redact sensitive information before sharing it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Resolve a stale host-key warning after a reinstall

Reinstalling or rebuilding a VPS can generate a new host key. SSH then warns that the key for the hostname has changed because the saved identity no longer matches. First verify through your provider or administrator that the VPS was genuinely rebuilt and that the new fingerprint is expected. A changed key can also indicate a man-in-the-middle attack; never bypass the warning merely to make the connection work.

After confirming the change, remove the old entry:

ssh-keygen -R hostname

Run the connection again, inspect the newly displayed fingerprint, and accept it only after that second verification. If you normally connect by IP address and by hostname, each may have a separate entry; remove the exact name that produced the warning.

Harden the SSH server safely

Find and edit the server configuration

Server-side settings are normally in /etc/ssh/sshd_config. Edit the file with administrative privileges, using the editor available on your distribution. Make one change at a time and preserve a copy of the original configuration so you can recover from an error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm key access before disabling passwords

Generate and install a key, then prove it works in a separate terminal. Keep the existing session open while testing. Only after the second session succeeds should you set:

PasswordAuthentication noPubkeyAuthentication yes

The PasswordAuthentication keyword is part of OpenSSH; its documented default is yes. Setting it to no prevents password-based SSH authentication, but it does not create a working key for you. If key login has not been tested, you can lock yourself out.

Decide how root may log in

PermitRootLogin accepts several values:

Value Effect When it fits
yes Allows direct root SSH login, subject to other authentication settings. Only when direct root access is an explicit operational requirement.
prohibit-password Disallows password authentication for root but permits key-based root login. Useful when controlled key-based root access is still needed.
forced-commands-only Limits root keys to forced commands rather than an ordinary interactive login. Special automation cases where a key should run one restricted action.
no Disables remote root login. The strictest choice when administrators can use a separate account and elevate privileges.

Defaults vary by distribution and release. RHEL 10 defaults to prohibit-password, while an older Ubuntu focal manual page documents the accepted values rather than establishing the default for every current Ubuntu release. Check the manual page and image documentation on the VPS you actually administer instead of assuming one distribution’s default applies everywhere.

Scope exceptions with Match

OpenSSH supports Match blocks, allowing settings such as PasswordAuthentication or PermitRootLogin to apply only to specified addresses or users. This can preserve a narrowly defined administrative path, but indentation and block order matter. Read the effective configuration for the target release and test from the intended network before relying on an exception.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validate and reload carefully

Validate the syntax before restarting the daemon:

sshd -t

The availability and exact behavior of this check should be confirmed on the target system’s OpenSSH release. If validation reports an error, do not restart with the broken file. Service names also vary: many Linux systems use systemctl restart ssh, while others expose an sshd service. Confirm the correct unit for the distribution. Keep your established session open until a new connection proves that the edited policy works.

Choose the right command for the job

Need Best starting command Reason Main caution
Open an administrative shell ssh Encrypted interactive session. Use the correct username and port.
Create credentials ssh-keygen Creates a local private/public key pair. Protect the private key with a passphrase and never upload it.
Install a public key ssh-copy-id Places the key in the account’s authorized_keys. Unavailable in standard Windows PowerShell; use the manual method.
One-time file copy scp Simple upload, download, or recursive copy. Port option is uppercase -P.
Repeated folder synchronization rsync Sends only changes and supports dry runs. --delete can remove destination files.
Inspect a failing connection ssh -v Shows where negotiation or authentication stops. Redact sensitive diagnostic output.
Forget a confirmed obsolete host key ssh-keygen -R Removes a saved known_hosts entry. Verify a rebuild before accepting a replacement key.

Ed25519 or RSA: a practical decision

Choice Command Use it when
Ed25519 ssh-keygen -t ed25519 -C "[email protected]" The VPS runs a current OpenSSH implementation; this is the normal modern choice.
RSA 4096 ssh-keygen -t rsa -b 4096 An older server or appliance requires broader legacy compatibility.

A safe first-day workflow

  1. Connect with ssh user@host, adding lowercase -p if required.
  2. Create an Ed25519 key locally, or RSA 4096 only for compatibility.
  3. Install the public key with ssh-copy-id and test it in a second session.
  4. Use scp for an occasional file and rsync for recurring synchronization; preview destructive synchronization with rsync -avzn.
  5. If a connection fails, collect clues with ssh -v rather than repeatedly guessing passwords.
  6. After confirming key access, edit /etc/ssh/sshd_config, consider disabling password authentication and restricting root login, validate the file, and restart the correct service while retaining the original session.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.