Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Hiding smb mount password in fstab? Hashing?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
humbletech99
Veteran
Veteran
User avatar
Posts: 1229
Joined: Thu May 26, 2005 9:30 am
Location: London

Hiding smb mount password in fstab? Hashing?

  • Quote

Post by humbletech99 » Thu Mar 23, 2006 9:48 am

Hi,
I'm looking for a way to hide my credentials in fstab for lines like

Code: Select all

//hostname/share   smbfs   /mnt/sharename     defaults,username=user%password       0      0
The problem with the above line is that it appears in the process list and that the password is in cleartext. Using credentials=file is a better start but this is still in plaintext. Can't I hash the password with md5 or something?
The Human Equation:

value(geeks) > value(mundanes)
Top
unclecharlie
Apprentice
Apprentice
User avatar
Posts: 186
Joined: Mon Dec 19, 2005 12:13 pm
Location: Colorado, USA

i know...

  • Quote

Post by unclecharlie » Thu Mar 23, 2006 2:43 pm

humbletech99,

Yeah it sucks. I've been pondering other solutions to that one myself. MD5 won't work. It's not reversible. The simple option is to keep the credentials file on a keychain USB drive and use it like a key. Other options include making an encrypted loopback filesystem and keeping the credentials file there. But that presents it's own problems.

I'd love to hear anyone's ideas on a solution for this.

Charlie
Top
humbletech99
Veteran
Veteran
User avatar
Posts: 1229
Joined: Thu May 26, 2005 9:30 am
Location: London

  • Quote

Post by humbletech99 » Thu Mar 23, 2006 3:16 pm

The keychain won't work as this is for servers, but the loopback encryption is interesting, couple of drawbacks though:

1. You'd have to set up the loop after boot so again no good for fstab.
2. once you mount the loop to access the credentials file it's plain text readable again

Argg, this is such an obvious problem, why isn't there an obvious solution? If the password was stored as an ntlm hash, that would be better... you could sent it straight but no human could know what it is or use it without using a custom written program to sent it straight...
The Human Equation:

value(geeks) > value(mundanes)
Top
toralf
Developer
Developer
User avatar
Posts: 3944
Joined: Sun Feb 01, 2004 2:58 pm
Location: Hamburg
Contact:
Contact toralf
Website

  • Quote

Post by toralf » Thu Mar 23, 2006 3:26 pm

What about setting perms to 0600 to the credential file where you store the sense information ?
Top
humbletech99
Veteran
Veteran
User avatar
Posts: 1229
Joined: Thu May 26, 2005 9:30 am
Location: London

  • Quote

Post by humbletech99 » Thu Mar 23, 2006 4:10 pm

yeah, but this is quite easy to work around and just read the info off disk, but it really what I will have to resort to otherwise...
The Human Equation:

value(geeks) > value(mundanes)
Top
Vulpes_Vulpes
Apprentice
Apprentice
User avatar
Posts: 264
Joined: Wed Dec 10, 2003 9:33 am
Location: Amsterdam

  • Quote

Post by Vulpes_Vulpes » Thu Mar 23, 2006 5:06 pm

humbletech99 wrote:yeah, but this is quite easy to work around and just read the info off disk, but it really what I will have to resort to otherwise...
But don't you have to be root to read the 0600 chmodded credential file? I'm really interested in the workaround you mentioned.
Top
unclecharlie
Apprentice
Apprentice
User avatar
Posts: 186
Joined: Mon Dec 19, 2005 12:13 pm
Location: Colorado, USA

not the drawbacks I was thinking of...

  • Quote

Post by unclecharlie » Thu Mar 23, 2006 5:10 pm

humbletech99,

What I was pondering was this-
Even setting up an encrypted file system, the key for that filesystem is still going to be in a credentials file in plain text somewhere on the system, either in /etc/fstab or a credentials file.

A password management daemon could be useful for that. But making it secure without an interactive (challenge/response) might be difficult.

Charlie
Top
PMcCauley
Apprentice
Apprentice
Posts: 283
Joined: Tue Mar 14, 2006 11:38 pm
Location: Alberta, Canada

  • Quote

Post by PMcCauley » Thu Mar 23, 2006 5:29 pm

One way to do it is to have your samba only accessible by localhost and forward samba through ssh then you could use a key file. There is no getting around all the security problems. You will either have to enter the password to mount the drive of take the chance that it someone gets your key they would have access. Hashed or not a non-password protected key file could be used the same as the actual password. You could also use sshfs to mount ssh directly.

Code: Select all

emerge sshfs-fuse
sshfs remote-system-name:/remote-folder /media/mount-name
The only way someone should be able to gain access to a chmod 600 file is in a offline attack(boot live cd or whatever) or possibly a vunerablity in a root-enabled program. Setting up shared keys between the systems would probably be easiest.


Patrick
Top
humbletech99
Veteran
Veteran
User avatar
Posts: 1229
Joined: Thu May 26, 2005 9:30 am
Location: London

  • Quote

Post by humbletech99 » Thu Mar 23, 2006 5:32 pm

Vulpes_Vulpes wrote:
humbletech99 wrote:yeah, but this is quite easy to work around and just read the info off disk, but it really what I will have to resort to otherwise...
But don't you have to be root to read the 0600 chmodded credential file? I'm really interested in the workaround you mentioned.
reboot the machine into knoppix. steal a machine, pull out the hard disk, load another os etc. etc.
The Human Equation:

value(geeks) > value(mundanes)
Top
humbletech99
Veteran
Veteran
User avatar
Posts: 1229
Joined: Thu May 26, 2005 9:30 am
Location: London

  • Quote

Post by humbletech99 » Thu Mar 23, 2006 5:34 pm

I need to stick to SMB since I'm in a heterogenous environment...
The Human Equation:

value(geeks) > value(mundanes)
Top
Post Reply

10 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic