Menu

Set up Samba in Ubuntu/Linux, and access it in Mac OS and Windows

Setting up the Samba File Server on Ubuntu/Linux:
  1. Open the terminal
  2. Install samba with the following command:   sudo apt-get install samba -y
  3. Configure samba typing: sudo vi /etc/samba/smb.conf
  4. Set your workgroup (if necesary). Go down in the file, until you see :

    # Change this to the workgroup/NT-domain name your Samba server will part of
       workgroup = WORKGROUP
  5. Set your share folders. Do something like this (change your path and comments)

    # Xuan Anh share
    [XuanAnhShare]
      comment = YOUR COMMENTS
      path = /your-share-folder
      read only = no
      guest ok = yes
      browseable = yes
      force user = username of samba server (fix permission denied)
  6. Restart samba. type: sudo /etc/init.d/smbd restart
  7. Create the share folder: sudo mkdir /your-share-folder
  8. Set the permissions: sudo chmod 0777 /your-share-folder
  9. you are all set in ubuntu
Accessing Samba Server Files from:
Ubuntu
Khi mount samba share bang GUI thi khong the import project vao eclipse vi duong dan la mot uri, khong phai filesystem, do do o day ta su dung lenh mount de mount share folder tu samba server thanh local file system, sau do ta se co the import file hoac project vao eclipse nhu binh thuong
  1.  mkdir /home/$(id -un)/samba_share
  2. sudo apt-get install cifs-utils -y
  3. sudo mount -t cifs -o username=Anonymous,uid=$(id -u $username),gid=$(id -g $username)  //ip-to-server/XuanAnhShare /home/$(id -un)/samba_share
         ex:
sudo mount -t cifs -o username=Anonymous,uid=$(id -u $username),gid=$(id -g $username)  //10.70.63.60/XuanAnhShare /home/$USER/samba_share
         output:
Password for Anonymous@//10.70.63.60/XuanAnhShare:
         Press Enter

Mac OS
  1. Open finder
  2. Menu Go -> Connect to server (command-k)
  3. In the “Server Address” textbox, type: smb://<your-ip-address-to-ubuntu>
  4. Connect
  5. Select guest and OK
  6. Your all set, you’ll be able to see /<your-share-folder> from here.
Windows
  1. Start button -> Run
  2. Type: \<your-ip-address-to-ubuntu>\<your-share-folder>
  3. All set
If you need to enable the samba ports in your firewall these are the ports:

port type    port no
udp        137
udp        138
tcp        139
tcp        445

1 nhận xét :