Wednesday, November 08, 2006

File Sharing in LAN

How to change computer Domain/Workgroup

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Find this line
             ...
workgroup = MSHOME
...
  • Replace with the following line
             workgroup = new_domain_or_workgroup
  • Save the edited file
             sudo testparm
sudo /etc/init.d/samba restart

How to share folders the easy way

  • Right click on folder -> Share folder
  • Shared folder -> Share with: Select "SMB"
  • Share properties -> Name: Specify the share name

How to browse network computers

  • Places -> Network Servers

How to access network folders without mounting

Assumed that network connections have been configured properly
Network computer's IP: 192.168.0.1
Shared folder's name: linux
  • Press 'Alt+F2' (Run Application...) and enter:
smb://192.168.0.1/linux

How to mount/unmount network folders manually, and allow all users to read/write

Assumed that network connections have been configured properly
Network computer's IP: 192.168.0.1
Network computer's Username: myusername
Network computer's Password: mypassword
Shared folder's name: linux
Local mount folder: /media/sharename
  • To mount network folder
      sudo mkdir /media/sharename
sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
  • To unmount network folder
      sudo umount /media/sharename/

How to mount network folders on boot-up, and allow all users to read/write

sudo mkdir /media/sharename
gksudo gedit /root/.smbcredentials
  • Insert the following lines into the new file
      username=myusername
password=mypassword
  • Save the edited file
     sudo chmod 700 /root/.smbcredentials
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Append the following line at the end of file
     //192.168.0.1/linux    /media/sharename smbfs  credentials=/root/.smbcredentials,dmask=777,fmask=777  0    0
  • Save the edited file

No comments: