LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-13-2010, 02:36 PM   #1
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Rep: Reputation: 15
Question Automatic authentication


Hey all,

I have a server A that needs to connect to another server (B) to transfer data everyday.
[A] ==SFTP==> [B]

I am using SFTP for the data transfert between A and B.

I configured B to allow authentication only with a key, not with password.
However, anybody who acccess the filesystem of A, could steal the password.

So I thought I could password protect the private key from A.

But in such a case, I need to store the password somewhere on A, so the server A can access the private key to connect to B.

Finally, it is endless: i always have to store somewhere a secret on A.

Is there another solution that allow to have an authentication between A and B without storing plain text secret on the server A ?

Thanks
 
Old 04-13-2010, 03:00 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Passwordless authentication for ssh and such does not store a plain text password....

You should have a public key and a private key on the server and the public key on the remote.

Last edited by rweaver; 04-13-2010 at 03:02 PM.
 
Old 04-13-2010, 03:09 PM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by rweaver View Post
You should have a public key and a private key on the server and the public key on the remote.
That's true, but you'd still need to deal with authentication on the remote (server A) side somehow. It seems to me like PlatinumX wants to have a way to authenticate server A to server B without credentials having to reside on server A. I don't see how that could be possible. You could, however, reduce the risk by increasing your abilities to quickly detect that the credentials have been compromised (with an intrusion detection system, for example). Of course, this also implies having everything ready to revoke the credentials and respond to the security breach.

Last edited by win32sux; 04-13-2010 at 03:48 PM.
 
1 members found this post helpful.
Old 04-14-2010, 02:32 AM   #4
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Question

Quote:
It seems to me like PlatinumX wants to have a way to authenticate server A to server B without credentials having to reside on server A
Exactly.
If I choose password authentication for SSH, the password will reside in plain text on the server A.

If I choose key authentication for SSH, the private key will reside unprotected(not password protected)on the server A.

According to Win32sux, the best I can do is limiting read access on the private key, and auditing access to the privat key to detect abnormal access.

Something more ?
Thanks

Last edited by PlatinumX; 04-14-2010 at 02:34 AM.
 
Old 04-14-2010, 03:39 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Password protect your private key and use ssh-agent to fill in store the password.
 
Old 04-14-2010, 04:20 AM   #6
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
You can also apply restrictions in the (public) key itself on what is allowed.
 
Old 04-14-2010, 02:19 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
You're not going to be able to do this cleanly if Server A can not be trusted (and it sounds like that is what you are saying). What are the exact circumstances in this situation? Maybe there's a better approach to it.
 
Old 04-14-2010, 09:26 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'd use a combination of:

1. auth keys
2. on A, create a separate user and set home dir to 700 (rwx------) to do the job
3. on B, use the options in sshd_config of : ForceCommand, Match, Allowusers, Address http://www.openbsd.org/cgi-bin/man.c...nfig&sektion=5 to lock everything down.
 
Old 04-14-2010, 11:14 PM   #9
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
Quote:
Originally Posted by chrism01 View Post
3. use the options in sshd_config of : ForceCommand, Match, Allowusers, Address to lock everything down.
Just in case anyone doesn't realise, if you don't want to lock down the entire sshd you can specify constraints actually in the public key itself.

http://www.openbsd.org/cgi-bin/man.c...penBSD+Current

and Step 6 in:

http://e-articles.info/e/a/title/Usi...ile-Transfers/
 
1 members found this post helpful.
Old 04-14-2010, 11:33 PM   #10
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by bakdong
... if you don't want to lock down the entire sshd you can specify constraints actually in the public key itself.

http://www.openbsd.org/cgi-bin/man.c...penBSD+Current
As an aside, very handy options. (Too bad I am not running any systems with such a recent OpenSSH. I may need to finally build openssh-portable on my FBSD 6 host.)
 
Old 04-15-2010, 02:39 AM   #11
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
That's interesting, yes. I don't know when the extra facilities were added, I just assumed that it was all part of the SSH-2 standard. The oldest system I'm running at the moment is RH7.3 with OpenSSH3.5p1 and it seems to recognise the constraints.
 
Old 04-16-2010, 04:00 AM   #12
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Quote:
You're not going to be able to do this cleanly if Server A can not be trusted (and it sounds like that is what you are saying). What are the exact circumstances in this situation? Maybe there's a better approach to it
Server A has not only one administrator but several to perform various tasks.
I do trust my security administrator, but not the system admin or the network admin.
But as they have root access on the server, they can access the private key or the password.

Here is my main concern.
 
Old 04-16-2010, 04:21 AM   #13
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
They may be able to access the private key, but they will still be restricted by the constraints that you put on that key on the remote servers, so this may not be a problem.
 
  


Reply



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
Authentication service cannot retrieve authentication info joshb166 Linux - Newbie 2 08-13-2009 01:03 AM
su: Authentication service cannot retrieve authentication info. r11_kaede Linux - Newbie 3 05-17-2009 12:10 PM
Authentication service cannot retrieve authentication info - for new user yosial Linux - Newbie 2 10-28-2008 11:30 PM
Konqueror automatic smb authentication teamanx Linux - Networking 3 03-19-2008 07:13 AM
Authentication service cannot retrieve authentication info Moffett67 Linux - Software 3 12-13-2007 03:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:48 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