Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2nd December 2011, 01:57 AM
dth4h's Avatar
dth4h Offline
Registered User
 
Join Date: Mar 2009
Posts: 182
linuxchrome
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:
Code:
gpg -c FILE
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?
Reply With Quote
  #2  
Old 2nd December 2011, 03:23 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,689
linuxfirefox
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
Reply With Quote
  #3  
Old 3rd December 2011, 04:42 AM
dth4h's Avatar
dth4h Offline
Registered User
 
Join Date: Mar 2009
Posts: 182
linuxchrome
Re: How to encrypt my password file?

Quote:
Originally Posted by Gareth Jones View Post
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?
Reply With Quote
  #4  
Old 3rd December 2011, 05:37 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,689
linuxfirefox
Re: How to encrypt my password file?

Quote:
Originally Posted by dth4h View Post
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
Reply With Quote
  #5  
Old 3rd December 2011, 05:44 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,118
linuxfirefox
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.
Reply With Quote
  #6  
Old 4th December 2011, 04:12 AM
dth4h's Avatar
dth4h Offline
Registered User
 
Join Date: Mar 2009
Posts: 182
linuxchrome
Re: How to encrypt my password file?

Quote:
Originally Posted by Gareth Jones View Post
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.
Reply With Quote
Reply

Tags
encrypt, file, password

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupted GDM and GDM-PASSWORD file Steevo25 Using Fedora 0 20th October 2010 09:26 AM
How to encrypt the root file system after installation allchacha Using Fedora 1 25th February 2009 10:21 AM
How can I know the method of encrypt of password youhaodeyi Using Fedora 3 3rd September 2008 08:21 AM
Encrypt password for NFS zackiv31 Using Fedora 1 13th June 2007 06:17 PM


Current GMT-time: 07:43 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat