LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-25-2008, 03:45 PM   #1
BlackGerm
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
Exclamation Truecrypt & Samba


Hi,

I just had the idea that I would like to use data encryption on my server as I have kind of sensible data on it.

Having a TrueCrypt running automatically on server boot and opening the container files is not an option for me.

I was thinking of the solution:
  1. Have several TrueCrypt containers that contain data. One for each wanted Samba share/user.
  2. When I log on on the Samba domain the username + password gets passed on to TrueCrypt and opens the container files for this user/share.

If this is some how possible then I would like to get it working in a multi user environment.
Just now I would not know how I could tell samba to start TrueCrypt and hand over the username + password every time a user is logging in.

I know that I could put the container files inside a Samba share and use TrueCrypt on the client, but I guess that would be a huge performance issue opening the container file via a network connection. Also I would have quite some drive letters to deal with. One for the share containing the container file and an additional one to mount the container file to the client with TrueCrypt itself.

Is there any good solution to this? Any other suggestions on how to handle this?

Thanks
... Black
 
Old 10-02-2008, 12:03 PM   #2
Run Seven
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Hi,

did you come to any solution? I am facing the same problem...
 
Old 10-04-2008, 08:32 AM   #3
Run Seven
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
The soultion seems to be to use pam_mount to pass on the password to mount the encrypted volume. My common_pammount, common_auth and common_session look like this:

Code:
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.
#
auth	requisite	pam_unix.so nullok_secure
auth	optional	pam_smbpass.so migrate missingok
auth optional pam_mount.so try_first_pass

#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive).  The default is pam_unix.
#
session	required pam_unix.so
session optional pam_mount.so 

# Include this file in every /etc/pam.d/SERVICE you use for login:
# [...]
# @include common-auth
# @include common-session
# [...]
# # added for libpam-mount
# @include common-pammount
#
# Make sure that the common-auth and common-session includes are
# above the common-pammount include (just as in the example above).

# replace "optional" with "required" if a user must mount the specified
# volumes, for example the home directory

# make sure that there is no PAM module loaded with a "sufficient"
# priority before these entries, else the pam_mount module is not
# executed

# for configuration details about different login programs see
# /usr/share/doc/libpam-mount/README.Debian.gz

auth       optional   pam_mount.so try_first_pass
session    optional   pam_mount.so try_first_pass
These files are included in the samba file in /etc/pam.d as well as in the login file.

The pam_mount.conf.xml file has the following lines in it:

Code:
<pam_mount>
<volume
        user="ntheis"
        fstype="truecrypt"
        server="j1112801"
        path="/dev/sda1"
        mountpoint="/home/ntheis/crypt"
/>
When I log in as user "ntheis", the samba log file for the windows machine I logging in with shows the following lines:

Code:
[2008/10/04 12:18:21, 0] lib/util_sock.c:write_data(562)
  write_data: write failure in writing to client 192.168.0.100. Error Connection reset by peer
[2008/10/04 12:18:21, 0] lib/util_sock.c:send_smb(761)
  Error writing 4 bytes to client. -1. (Connection reset by peer)
pam_mount(pam_mount.c:460) Entered pam_mount session stage
pam_mount(pam_mount.c:481) back from global readconfig
pam_mount(pam_mount.c:483) per-user configurations not allowed by pam_mount.conf.xml
pam_mount(pam_mount.c:512) error trying to retrieve authtok from auth code
pam_mount(pam_mount.c:202) enter read_password
pam_mount(pam_mount.c:515) error trying to read password
pam_mount(pam_mount.c:548) done opening session (ret=7)
pam_mount(pam_mount.c:460) Entered pam_mount session stage
pam_mount(pam_mount.c:481) back from global readconfig
pam_mount(pam_mount.c:483) per-user configurations not allowed by pam_mount.conf.xml
pam_mount(pam_mount.c:512) error trying to retrieve authtok from auth code
pam_mount(pam_mount.c:202) enter read_password
pam_mount(pam_mount.c:515) error trying to read password
pam_mount(pam_mount.c:548) done opening session (ret=7)
pam_mount(pam_mount.c:116) Clean global config (0)
[2008/10/04 12:18:23, 1] smbd/service.c:make_connection_snum(1033)
  freakbox (192.168.0.100) connect to service crypt initially as user ntheis (uid=1001, gid=1001) (pid 6246)
What am I doing wrong? Can somebody please help me with this?

Thanks in advance
Run Seven
 
  


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
truecrypt koker Grafpup 1 01-03-2008 10:55 AM
SAMBA & CUPS (Linux & Windows Printing) xcythe Linux - Networking 4 06-12-2005 11:46 AM
Samba & IPTABLES & Network Drives Oh My! logicdisaster Linux - Networking 3 06-03-2004 06:07 PM
SuSE9 && Samba && Win2k DaFrEQ Linux - Software 2 01-27-2004 07:45 AM
Samba: Authenticate Linux-Clients in Samba Domain & Mount mule Linux - Software 0 12-10-2003 01:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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