 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

2nd December 2011, 01:57 AM
|
 |
Registered User
|
|
Join Date: Mar 2009
Posts: 182

|
|
|
How to encrypt my password file?
I put this command in a script to connect to a Windows share:
Code:
sudo mount -t cifs //$router.$number/users /mnt/dtelite/ -o credentials=/home/Daniel/.dhid/sambacreds
The bold part tells it where the file is that has my password and other details in it. But the file is just plain text, so anyone who opens the text file can see my password.
So I looked up how to encrypt a file and I found this command:
But that original command I posted cannot read the encrypted file so it asks me for the password.
Is there some other way to encrypt my password so the command can still read it or is it something that can't be done?
|

2nd December 2011, 03:23 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,689

|
|
|
Re: How to encrypt my password file?
Your file permissions should be enough to protect you from other users on the computer, unless they're root of course.
If you just want the password encrypted on disk, but don't mind it being unencrypted in the virtual filesystem, you could look at ecryptfs. Ecryptfs mounts on top of a real directory, and encrypts any files written to that directory, transparently decrypting them when they're read. Of course, you have to ensure that the ecryptfs was mounted before the CIFS share.
You could unmount the ecryptfs again after mounting the CIFS if you want, but by this stage you'd probably have to script the process, and if you do that you might as well stick to GPG.
Gareth
|

3rd December 2011, 04:42 AM
|
 |
Registered User
|
|
Join Date: Mar 2009
Posts: 182

|
|
|
Re: How to encrypt my password file?
Quote:
Originally Posted by Gareth Jones
Your file permissions should be enough to protect you from other users on the computer, unless they're root of course.
If you just want the password encrypted on disk, but don't mind it being unencrypted in the virtual filesystem, you could look at ecryptfs. Ecryptfs mounts on top of a real directory, and encrypts any files written to that directory, transparently decrypting them when they're read. Of course, you have to ensure that the ecryptfs was mounted before the CIFS share.
You could unmount the ecryptfs again after mounting the CIFS if you want, but by this stage you'd probably have to script the process, and if you do that you might as well stick to GPG.
Gareth
|
Thanks Gereth,
I have changed my file permissions. It's nice to know about ecryptfs in case I need it in the future.
Just curious, if someone used sudo, can they still see the file?
|

3rd December 2011, 05:37 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,689

|
|
|
Re: How to encrypt my password file?
Quote:
Originally Posted by dth4h
Just curious, if someone used sudo, can they still see the file?
|
Yes, su or sudo would give them the root privileges that would let them read any file on the system.
Gareth
|

3rd December 2011, 05:44 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,118

|
|
|
Re: How to encrypt my password file?
Quote:
|
Originally Posted by Gareth Jones
Yes, su or sudo would give them the root privileges that would let them read any file on the system.
|
Well, not if that user was not setup in the sudoers file to have root privileges and was never given the password for root or the password for user dth4h they wouldn't.
|

4th December 2011, 04:12 AM
|
 |
Registered User
|
|
Join Date: Mar 2009
Posts: 182

|
|
|
Re: How to encrypt my password file?
Quote:
Originally Posted by Gareth Jones
Yes, su or sudo would give them the root privileges that would let them read any file on the system.
Gareth
|
Ok well I guess I will just have to figure out how to set up the sudoers file so that they can only do certain things with it, instead of having full root access. Thanks again Gareth.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 07:43 (Sunday, 19-05-2013)
|
|
 |
 |
 |
 |
|
|