#1 (permalink)  
Old 04-05-2008, 01:43 PM
isputra's Avatar
Registered User
 
Join Date: May 2003
Location: Mbelitar
Posts: 592
isputra
Create SSH Keys and login using putty - access denied

Hi,

I'm trying to create keys for my putty like this manual :

http://www.webhostingtalk.com/showthread.php?t=664763

But when i login to root using putty always failed with access denied message.

Anyone here have the same problem and have solution ?
__________________
It's me ...... It's me ......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-05-2008, 03:28 PM
Registered User
 
Join Date: Sep 2004
Posts: 26
RSCChris is on a distinguished road
Whenever I use keys I just use the PuttyGEN program to make the key and then I upload it to the server. Do you load the key when you try to login via putty? If you don't tell the client to load the key, then it won't send it to the server and you won't be able to log in.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-06-2008, 10:50 AM
isputra's Avatar
Registered User
 
Join Date: May 2003
Location: Mbelitar
Posts: 592
isputra
I'm root.

I also try to use Puttygen and upload the key. But the result is the same.

When i try to restart sshd through WHM, it's failed on message but i still can access it so it's not fail.

Something wrong here but i can't figure it out.
__________________
It's me ...... It's me ......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-06-2008, 08:53 PM
Registered User
 
Join Date: Mar 2006
Posts: 1,215
jayh38 is on a distinguished road
I've never used the cpanel / whm interface to setup keys but its very simple to do manually. Perhaps you just need a sshd_config adjustment.


1. First copy your public key to your clipboard.
2. Add your key to /root/.ssh/authorized_keys (create the directory and file if it doesn't exist, one key per line.)
3. chmod authorized_keys to 0600
4. Edit /etc/ssh/sshd_config uncomment the following lines:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

5. Restart sshd

Thats pretty much it. Once you verify your key works, then modify sshd_config again and comment out password authentication if desired.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-11-2008, 04:21 AM
isputra's Avatar
Registered User
 
Join Date: May 2003
Location: Mbelitar
Posts: 592
isputra
Quote:
Originally Posted by jayh38 View Post
I've never used the cpanel / whm interface to setup keys but its very simple to do manually. Perhaps you just need a sshd_config adjustment.


1. First copy your public key to your clipboard.
2. Add your key to /root/.ssh/authorized_keys (create the directory and file if it doesn't exist, one key per line.)
3. chmod authorized_keys to 0600
4. Edit /etc/ssh/sshd_config uncomment the following lines:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

5. Restart sshd

Thats pretty much it. Once you verify your key works, then modify sshd_config again and comment out password authentication if desired.
Hi,
still not works.

-------------------------
login as: root
Authenticating with public key "rsa-key-root"
Passphrase for key "rsa-key-root":
Access denied
root@xx.xx.xx.xx's password:
--------------------------

Could you give me the inside of your sshd_config file ? I think something messy on my part that affecting my ssh login.
__________________
It's me ...... It's me ......

Last edited by isputra; 04-11-2008 at 04:26 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-11-2008, 06:48 AM
nyjimbo's Avatar
Registered User
 
Join Date: Jan 2003
Location: New York
Posts: 1,021
nyjimbo is on a distinguished road
Do you have the whole suite of programs from the Putty group. If so then start "PAgeant", which is the putty key auth agent. When you see it in your toolbar like your other running programs (usually near the time) right click on it and go to VIEW KEYS, the big white box will probably be empty, next click on ADD KEY, it should then bring up a file finder for you to locate the key on your local PC. Find the *.ppk file and open/add it. If it has a pass-phrase it will ask you for it, if you get it right it will add it to the keys listed. You can then try to logon to your system again with this Agent running, but you dont have to.

The reason to do the above is to make sure the key is properly formatted on your pc and that your password really does match what you think it is. Give it a try and let us know if that part works.
__________________
"A dog has raised it’s hind leg on the age of nevermore !"
-- Rolf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-12-2008, 06:39 AM
isputra's Avatar
Registered User
 
Join Date: May 2003
Location: Mbelitar
Posts: 592
isputra
Quote:
Originally Posted by nyjimbo View Post
Do you have the whole suite of programs from the Putty group. If so then start "PAgeant", which is the putty key auth agent. When you see it in your toolbar like your other running programs (usually near the time) right click on it and go to VIEW KEYS, the big white box will probably be empty, next click on ADD KEY, it should then bring up a file finder for you to locate the key on your local PC. Find the *.ppk file and open/add it. If it has a pass-phrase it will ask you for it, if you get it right it will add it to the keys listed. You can then try to logon to your system again with this Agent running, but you dont have to.

The reason to do the above is to make sure the key is properly formatted on your pc and that your password really does match what you think it is. Give it a try and let us know if that part works.
Nope.. still not works.

I think that there is something wrong with sshd_config because some parameter write double like :

PasswordAuthentication yes
UsePAM yes

That's why i need another sshd_config to look for
__________________
It's me ...... It's me ......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-12-2008, 08:44 PM
nyjimbo's Avatar
Registered User
 
Join Date: Jan 2003
Location: New York
Posts: 1,021
nyjimbo is on a distinguished road
Quote:
Originally Posted by isputra View Post
Nope.. still not works.

I think that there is something wrong with sshd_config because some parameter write double like :

PasswordAuthentication yes
UsePAM yes

That's why i need another sshd_config to look for
Just to clarify things, did you do the pageant part where you locally add the key to pageant and it then verifies the password BEFORE you attempt to logon to your system via SSH?. Did that portion work?. If not, then you have a bad private key. If it DID then you at least verified the private key is valid and removed that as an possible issue.

If you really cannot get a copy of sshd_config the just go to any of the openssh mirrors (like ftp://ftp3.usa.openbsd.org/pub/OpenB...nSSH/portable/ ) and download any of the up to date versions of openssh and unpack it on your PC. Inside there is the sshd_config file in its original format.
__________________
"A dog has raised it’s hind leg on the age of nevermore !"
-- Rolf

Last edited by nyjimbo; 04-12-2008 at 08:54 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-05-2008, 10:34 PM
Registered User
 
Join Date: Aug 2004
Posts: 139
screege is on a distinguished road
I have a similar problem but not with root it actualkly works fine, I am using penguinet and when adding another user I generate the keys, authorize them and they even get in /root/.ssh/user and user.pub I even put shell access under whm but when trying to login it keeps asking me my username what should I put there? I am putting the cpanel user name as I generated the key also with the same name.

Thanks if anyone can help me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:42 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc