LinuxQuestions.org
Help answer threads with 0 replies.
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 10-19-2017, 09:35 PM   #1
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 201

Rep: Reputation: 31
Password Encryption


Hi all,

I come into an discussion with a colleague on password security. Could you hear the scenario and provide some opinion?

At work I have to manage an small application running on Linux that will login automatically to a service on regular basis. The login requires a login id and a password. Naturally I will have to store the credentials locally for automation. To store the credentials, using open source algorithms, the credentials can either be scrambled and stored in a file, or be encrypted with keys, and stored in some files.

Theoretically if someone can obtain these keys or files, then the credentials will be exposed.

My view is that, there wouldn't be much difference if the plain credentials are stored in a file?

What do you think?


Jerry.
 
Old 10-20-2017, 08:00 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
If the whole server is compromised then you can assume that the credentials can be used.

On the other hand, if the script containing an encrypted password somehow "escapes" then without the decryption key it's useless.

In the past we've made use of a secure key-store server when at startup other servers have transferred and decoded keys in to memory (actually /dev/shm) and used them from there. The advantage being that if the server is physically stolen and restarted the keys will no longer be in memory or on the device.

ANYWHERE that servers log in automatically to other servers is inherently a weakness if the client server is compromised.
 
Old 10-20-2017, 11:29 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
I suggest that you store the keys – possibly scrambled, to make it less-than-trivially-easy to snatch – in a file with a r--/---/--- permissions mask, granting only the Owner of the file only the ability to Read it. Then, be sure that the file is owned by the user-id that runs the application.

Now, secure the system so that no one can break into it.

Be sure also that the connection to the remote service uses cryptographic security, e.g. TLS/SSL. It is desirable that the connection uses digital certificates to further restrict who is capable of connecting to the remote service in the first place, but ex minimis be sure that the traffic is not passing over the Internet "in the clear."

Last edited by sundialsvcs; 10-20-2017 at 11:31 AM.
 
Old 10-22-2017, 09:57 PM   #4
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 201

Original Poster
Rep: Reputation: 31
Thanks for your replies.

Let's say the following command is used to 'make' the plain credentials stored in ~/.foo not so plain.

Code:
[client@CLIENT ~]$ chmod 600 ~/.foo
[client@CLIENT ~]$ openssl enc -base64 -in ~/.foo > ~/.bar
[client@CLIENT ~]$ chmod 600 ~/.bar
The client account has shell /sbin/nologin .

To me, the security level of ~/.bar is not any higher than ~/.foo . This password encryption is nothing more than a trickery.
 
  


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
[SOLVED] Password Encryption knoppixt Linux - Server 5 08-14-2010 07:13 AM
Linux password encryption and data encryption Tux-Slack Programming 4 06-20-2007 06:46 AM
Password Encryption morningkiran Linux - Security 2 10-10-2004 07:17 AM
password encryption Lanmate Linux - Security 2 12-26-2003 04:15 AM
Password encryption???: shakeeb Linux - General 4 11-07-2003 07:50 PM

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

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