Monday, May 4, 2009

Howto share folders from windows to Linux

The Problem:

I use two machines, one is a Linux based and one windows based. I need to share files between them.

The Solution:

One option is to use a network hard drive. It might be quite slow though.

Other option is to use windows share documents option. It is not the safest methods, but surely one of the easiest.

On Windows:

- Right click on the folder to be shared and select “sharing and Security...”








- mark “Share this folder on the network”
- give a network name – best if only one word (it is not case sensitive)
- if you will need to change the files and not only to view them mark also “Allow network users to change my files”








On Linux:

Gui solution:
- go to “Places” -> “Connect
to Server..."
- switch to “Widows Share” on service type
- On “Server:” enter the windows machine IP number
- On “Share:” enter the name of the shared folder as was entered on the Windows sharing options
- if you use a different user name enter your windows user name on “User Name:”
- You can use an alias for this folder on the Linux machine by entering a new name at “Bookmark name:”






Now you can see and use the folder and files.

Or using mount (not Gui):

- create a new mount point (e.g. /mnt/windowsshare)

- Use mount command:
mount -t cifs //serverIP/shareName -o username=WindowsUserName,password=WindowsPassword /mnt/windowsshare

Or edit /etc/fstab file:

mounting windows share:

//XXX.XX.XX.XX/shareName /mountpoint cifs auto,owner,rw,username=XXX,uid=XXX,gid=XXX 0 0NOTE! - it will not mount on startup. need to do: "sudo mount mountpoint" to mount. one can add password=[user-passwd] after username=[username] or instead username and password : credentials=[path to a file containing user and password]the file should contain the remote system properties:username=[username]password=[userpassword]

No comments:

Post a Comment

Please Comment this Post or send me an Email