Sharing to Windows and Mounting Windows Shares in Ubuntu

From D3xt3r01.tk
Jump to navigationJump to search

WHY

Because some of my colegues use Windows. One of them has a dir shared where the others put/get files to/from. I need to be able to access it too and share stuff for them to see in their "Network neighbourhood".

Mounting a Windows Share

Well, mounting windows shares is easy.

sudo apt-get install smbfs
sudo mkdir /media/mountname

add this line at the end of /etc/fstab ( to auto-mount it )

//server_ip/share_name  /media/mountname  cifs  guest,uid=1000,iocharset=utf8,codepage=unicode,unicode  0  0

and then do this to mount it ( it'll be auto-mounted at every boot )

sudo mount -a

or do this to mount manually

sudo mount //server_ip/share_name /media/mountname/ -t cifs -o guest,uid=1000,iocharset=utf8,codepage=unicode,unicode

Sharing a dir

We're gonna use samba.

sudo apt-get install nautilus-share

Then edit /etc/samba/smb.conf and search for [homes] . You should uncomment ( the ; char ) it so it would look like this

[homes]
   comment = Home Directories
   browseable = yes
   read only = no 

#also check the [globals] section to be like this

[global]
        security = user
        encrypt passwords = true
        map to guest = bad user
        guest account = nobody

Last step, reload samba and allow some users to auth.

sudo  smbpasswd -a username
# username should be a real system user 
sudo /etc/init.d/samba reload

LINKS

Mounting Windows Shares Permanently

Setting Up Samba