21
Jul
09

Howto: Share an NTFS Drive under Linux with Mac

 

Recently I wanted to share my external NTFS Hardrive connected to my Linux desktop station with my Mac Laptop. I thought about using NFS but I prefered Samba to be able accessing the drive using Windows…

 

1) The first thing to do is to install/activate Samba ( sudo apt-get install samba smbfs ), if you’re using Ubuntu (>= Hardy) just right click any directory on the NTFS drive and select “Share Folder”, a new box called “Folder Sharing” will open, select “Share this folder” and validate you’ll be prompted to install Samba, proceed…

 

2) The second thing to do is to allow your current Linux user to share the NTFS drive which is considered as root’s property. If you don’t do that you’ll get a 255 net usershare add error message icon_twistedgif. Edit the Samba Config File in sudo mode using a Text Editor (ie Gedit):

gksu gedit /etc/samba/smb.conf

And add this line in [global] section (Global Settings) :

usershare owner only = False

BTW add these lines too:

hosts allow = 127.0.0.1 192.168.1.0/24

this will allow connections from localhost (testing purpose) and your private network (192.168.1.0 change it according to your private network address range in which your Mac IP is included)

workgroup = WORKGROUP

or MSHOME depending on your Network Group, this is to allow visibility and connections from Windows Stations.

Check if the security option is enabled on user :

security = user

This will require an account on the Linux machine to access the shares.

 

samba_configuration

 

3) The third thing to do is to install the samba config manager GUI, it’s the easiest way to manage shares and Samba users, if you’re using Ubuntu/Debian/Fedora install “system-config-samba” package. icon_smilegif

Now go to System -> Administration, you’ll see a new entry : “Samba”, click it. (you can also hit Alt+F2 and run gksu system-config-samba)

Create a Samba User in Preferences -> Samba Users


sambausers

 

Create a Samba username identical to your current Linux username. For more security choose a different password.

 

4) Share your NTFS Drive ! Click on “Add Share” and select your drive root path (/media/disk-x) to share the whole partition.

Check Writable and Visible, and DON’T FORGET TO CHECK THE USERS ALLOWED TO ACCESS THE DRIVE icon_exclaimgif in the Access Tab (user created in Step 3)

 

samba_share_access

 

5) The final Step is to allow access to your samba share from outside (of course if you already run a firewall policy). If you don’t do that you won’t be able to access the shared drive, believe me I tried.

You have to open 4 ports : 137, 138, 139 and 445 in your Linux machine (don’t touch your router). icon_exclaimgif

If you’re using Firestarter there’s an existing rule called Samba (smb) that you just need to add.

Firestarter -> Policy -> Inbound Traffic Policy -> Add Rule


firestarter-samba

 

In IP, host or network specify your private network address range (in which your Mac IP is included) using this ip form : 192.168.1.0/24

 

6) Connect to your Linux Machine from your Mac : Toolbar -> Go -> Connect to Server :

 

macos_webdav

 

In server adress type :

smb://yourlinuxip

(ie smb://192.168.1.1)

You’ll be prompted to enter a username and a password, enter the username and password created in Step 3.

Et voilà ! icon_biggringif

 

If you want to write the NTFS partition you’ll have to install NTFS-3G (see this post)

 

About these ads

2 Responses to “Howto: Share an NTFS Drive under Linux with Mac”


  1. 1 pozycjonowanie stron www
    September 21, 2010 at 22:53

    really good information, well written, hope to read more from you. Regards : pozycjonowanie.citysoftware.com.pl


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: