•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  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
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • 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
  • 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
  • Contacts - Manage
  • SSH into Docker Container
  • Generate SSH Key
  • How To Secure cPanel?
  • Psychz CDN Products and Features Updates
  • In Comparison: Windows VS Linux
  • All You Need To Know About Cloud Deployment Models
  • Things To Consider When Selecting an Encryption Solution
  • Global Server Load Balancing
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company