LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 11-25-2010, 04:22 AM   #1
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Rep: Reputation: 16
ssh "Permission denied (publickey)"


If I try to connect to 192.168.1.100 server, I get:

Code:
martin@desktop:~> ssh -v 192.168.1.100
OpenSSH_4.1p1, OpenSSL 0.9.7g 11 Apr 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.
debug1: Connection established.
debug1: identity file /home/martin/.ssh/identity type 0
debug1: identity file /home/martin/.ssh/id_rsa type 1
debug1: identity file /home/martin/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.5p1
debug1: match: OpenSSH_3.5p1 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.1.100' is known and matches the RSA host key.
debug1: Found key in /home/martin/.ssh/known_hosts:23
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/martin/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/martin/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
Unfortunately, I don't manage this 192.168.1.100 server. Am I correct, that sshd on 192.168.1.100 supports only publickey authentication because:

Code:
debug1: Authentications that can continue: publickey
I have .ssh/id_rsa present. Any ideas, what might cause this "Permission denied (publickey)" issue?
 
Old 11-25-2010, 04:24 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Have you generated the public and private ssh key pair for your system? If the server is configured to use public key authentication, you will need to take your public key and place it on the server on the configured location.
 
Old 11-25-2010, 06:55 AM   #3
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 781

Rep: Reputation: 174Reputation: 174
ssh

If you have no direct access to this server, you wil have to provide your public key to the SYSADM staff that HAS access and ask them to install it so that you can access the account. While there, they should check the ownership and permissions of the account home, ~/.ssh folder, and files in ~/.ssh. If the permissions are wrong, ssh will refuse the connections: but the error generated is very clear about WHY and we are not seeing that.

To answer that question: yes it does appear that the server is set to allow access by secure key only.
 
Old 10-15-2014, 03:14 AM   #4
bindian0509
LQ Newbie
 
Registered: Oct 2014
Posts: 1

Rep: Reputation: Disabled
Red face SSHD config needs to be changed

Somehow the password based authentication has been diabled on the connecting server.

Here is the deal --


Step 1 : sudo vim /etc/ssh/sshd_config

Step 2 : find PasswordAuthentication .... infront of that change 'no' to 'yes'

Step 3 : sudo service ssh restart (Restart the SSHD server)


Thats it you can now log in to this server from any machine using user passwords
 
Old 10-19-2014, 06:47 PM   #5
simrika
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Rep: Reputation: 0
-Enter ssh-keygen command.
-Asks where to save the keys
-Passphrase will allow you to secure the private keys.
-Keys are generated in /root/.ssh/
-id_rsa is private key
-id_rsa.pub is a public key
-Copy the public key to the next server which you want to login to your current server without password. Let's say server A to server B.
- Enter command Ssh-copy-id -i .ssh/id_rsa.pub [from server A] root @192.168.0.x[server B]
-This ssh-copy-id will take this public key location and name of public key by default

Now you will be able to login.
 
Old 10-20-2014, 05:56 AM   #6
wpeckham
Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 781

Rep: Reputation: 174Reputation: 174
well duh!

so simrika, I take it you did not read the thread before posing?
OP cannot ssh to the server, so ssh-copy-id is not going to work either.
 
Old 10-20-2014, 08:30 AM   #7
simrika
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Rep: Reputation: 0
ok I think you need to have a username infront of your server's ip address. It should be ssh username@ip address.
 
Old 10-20-2014, 08:28 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,555

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Quote:
Originally Posted by m4rtin View Post
If I try to connect to 192.168.1.100 server, I get:

[CODE]martin@desktop:~> ssh -v 192.168.1.100
This is potentially your problem right there.

1. are you on the same subnet, in other words are you in that LAN?
2. is the UID from your workstation the same UID you are attempting to connect to on the server?
3. the standard process for using ssh is as follows:
Code:
$ ssh <remote_user>@<IP>
note the REMOTE_USER you are missing. depending on the versions of sshd and openssh being used it may or may not allows you to connect without a user, this might not be displayed as a user error as it is checking for some type of authentication to match with said user.

4. are you able to successfully ssh in without using public keys?
5. have you verified the permissions on both your system and the remote systems /home/remote_user/.ssh directory and files?

read the links in my sig for further details.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh -- Permission denied (publickey,password,keyboard-interactive). davidkline Linux - Networking 11 08-20-2014 02:19 PM
[SOLVED] ssh killing me :( Permission denied (publickey) grail Linux - Newbie 10 07-06-2010 10:47 AM
[SOLVED] SSH - Permission denied (publickey,keyboard-interactive) sarves Linux - Newbie 3 05-12-2010 12:55 AM
No longer able to log into ssh. Password right but "permission denied" Baix Linux - Software 11 11-21-2008 12:44 PM
ssh client say me Permission denied.(publickey). linderox Linux - Networking 2 02-27-2008 09:36 AM


All times are GMT -5. The time now is 10:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration