LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-26-2006, 12:19 PM   #1
zovres
Member
 
Registered: Sep 2002
Posts: 184

Rep: Reputation: 30
passwordless SSH works for root but not www-data


Hi, I set up a passwordsless ssh between 2 computers (with an rsa key). But when I "ssh -i id_rsa optimus@192.168.1.20" as www-data it asks me for the passphrase and doesn't work. When I do the same as root it works just fine.
I have check the permissions on the id_rsa file and www-data can use it.
I've tried evreything and haven't made any progress.

Any help is very much appreciated!

Thanks

Ben
 
Old 07-26-2006, 12:31 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,285

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Check your directory permissions. Your .ssh directory (under your HOME) should be mode 700. The files under that .ssh directory should be mode 600. Technically, as long as they are not writeable by non-owner you are OK. But I keep mine all tightened down to 700/600 personally.

Don't forget your HOME directory itself. It cannot be world-writeable! Many people get tripped up on this one. The loosest your want to go on your HOME directory permissions are 755.

SSH checks if these permissions are too loose, and if they are, pubkey authentication will not work. It is silently disallowed by sshd.

You probably don't want to allow root to directly ssh into your box, BTW. This is considered a security risk. Deny root in your sshd_config file, and if you need root access, ssh in as a normal user and then use su or sudo to go to root.

For troubleshooting ssh in general, on the client end run "ssh -vv username@computername" when you attempt to login. This gives you very verbose output of what is going on.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 01:34 PM
Can't get passwordless ssh working thorney Linux - Networking 3 11-27-2005 11:08 PM
Ssh passwordless : Urgent muneebs123 Linux - Security 23 06-21-2005 09:26 PM
Passwordless SSH for Cluster nedian123 Linux - Networking 3 12-07-2004 11:15 PM
Regarding Passwordless SSH nedian123 Linux - Software 1 08-05-2004 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration