Thursday, May 15, 2014

How to share/access Linux folder from Windows machine?

Samba is a service that would allow you to share your Linux folder so that you can access it on your Windows machines.
Here is a quick tutorial on how to do it.

1) first you need to check if the samba server is running or not
/sbin/service --status-all  | grep smb

If it is not running yet, try to start it

sudo /sbin/service smb start

2) second check if this shared definition exists in your smb.conf file

[homes]
         comment = Home Directories
         browseable = no
         writable = yes
         valid users = %S

In order to access the symlinks in your samba share, you need to add the followings to your global section:

[global]

follow symlinks = yes
wide links = yes
unix extensions = no

If the above does not exist in the smb.conf file, add them to the file

sudo emacs -nw  /etc/samba/smb.conf

Your home directory should be shared by default.

Once you have finished modifying the file, restart the samba service

sudo /sbin/service smb restart

3) If you still cannot access the shared in Windows, check and make sure the user is already in the samba database.
It will prompt for the password, it is good to use the same password you used to log into windows.

sudo smbpasswd -a nquach

Once you have everything setup, you can access your linux share on Windows by using this path.

\\linuxmachine\username or \\LinuxHostName\nquach

Cheers

No comments: