•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

SSH permission denied publickey

  • Home
  • Client
  • Qa Forum
  • SSH permission denied publickey

Posted By: Tristan | 1 Replies | Last Reply On: Jan 09, 2018 06:33:58

how can i fix ssh "permission denied (publickey)" error? 

Psychz - Girish

Votes: 0Posted On: Jan 09, 2018 06:33:58
 

Hi!

This error occurs when you are trying to connect to a remote server with "ssh". While connecting through SSh, a key pair is generated in the local host and copied on to the remote host for authentication. The SSH keys are used to establish a secure connection between the local and remote host. After setting up the SSH key, you can connect to the remote server without the password as the SSH key is secure enough and troublesome to decipher. Sometimes, the key is not copied completely or to the right destination. 


Please go to the following link to generate an SSh key pair and copy it to the remote machine.

https://www.psychz.net/client/question/en/generate-ssh-key.html


Here are some of the reasons due to which this error can occur.

1. Make sure that the public key you generate in the local host is copied to the remote host. The remote host identifies your machine with the same key pair. Please use the following command to copy the key to the remote host.

 

ssh-copy-id username@IP_address

 


2. Check the permissions on your remote host. You could be logging in as "root" but may not have the right permissions to log in. "/root", ".ssh" and authorized_keys all should be associated with the user "root". 

Please use the following command to grant permissions.

 

chown -R your_user:your_user .ssh

 


3. You might be using the wrong key to connect to the remote machine. Another reason might be that you changed the key name. restore the key to default name and use the following command to connect with the right key.

 

ssh -i ~/.ssh/private_key username@host

Was this reply helpful?

Related topics

  • Unable to Access The Server Via SSH
  • How to generate SSH Keys on Linux?
  • Linux File Permissions Cheat Sheet
  • How to remotely connect to a Linux machine using a smartphone?
  • SSH Reverse Tunnel
  • SSH File Transfer
  • SSH Agent Forwarding
  • SSH Keys - Create
  • Start SSH server?
  • Generate SSH Key
  • Psychz CDN Products and Features Updates
  • In Comparison: Windows VS Linux
  • All You Need To Know About Cloud Deployment Models
  • Tutanota "blocking" on Comcast Network sparks the debate of net neutrality again
  • DDoS Extortion: The Latest Nefarious Twist on Cyber Crime
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801