Monday, January 27, 2014

Setup Samba Server Under Ubuntu

Objective
  1. Set up Samba file sharing for Linux, Windows, Tablet
  2. Allow access of specified resources without login under the same LAN
  3. Allow login access of restricted resources under the same LAN
Install Steps
1. install Samba:
         sudo apt-get install samba
         sudo smbd start
        sudo ufw disable
2. configure /etc/samba/smb.conf:
sample file setup:
  [global]
    workgroup = workgroup
    server string = %h server (Samba, Ubuntu)
    security = user
    passdb backend = tdbsam
    cups options = raw
    map to guest = Bad User
    guest ok = yes
[homes]
comment = Home Directories
path = /home/user/Documents
valid users = %S
read only = No
create mask = 0755
browseable = No

[public]
comment = tmp directory
path = /home/public
read only = No

note that if public path is under /home/user, it doesn't work.

3. test:
  testparm
4. add user:
  sudo smbpasswd -a user
5. restart samba:
    sudo /etc/init.d/samba restart

View Shares
Suppose the Samba server IP address is 192.168.0.18
1. under Linux file manager:
smb://192.168.0.18/      --- to access public share
or
smb://192.168.0.18/user    --- to access restricted share

2. under Windows:
//192.168.0.18/      --- to access public share
or
//192.168.0.18/user    --- to access restricted share

3. under tablet:
install EZ file manager

Thursday, January 23, 2014

Setup MFC-7345N Scanner

I have a MFC-7345N 3-in-1 printer/scanner/fax, which was initially setup with a IP address of 192.96.96.199. Later on the IP address was changed to 192.168.0.199. The PC machines adapt to the change easily, but Ubuntu machines got stuck.
Here's how I re-setup my MFC-7345N scanner under Ubuntu.

  • check if the system is 32bit or 64bit: uname -a
  • download brscan3-0.2.11-5.amd64.deb and brscan-skey-0.2.4-1.amd64.deb
  • install package: sudo dpkg -i --force-all brscan3-0.2.11-5.amd64.deb brscan-skey-0.2.4-1.amd64.deb
  • check if the scanner model is supported, if not, choose a closer one:  brsaneconfig3 -q
  • configure the scanner: sudo brsaneconfig3 -a name=SCANNER model=MFC-7440N ip=192.168.0.199
  • check setup: brscan-skey -l
  • use gscan2pdf to scan
official instruction:
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_scn1b.html#config1

for ubuntu 18.04, needs to do:
For 64bit Users:
Command : sudo cp /usr/lib64/sane/libsane-brother* /usr/lib/x86_64-linux-gnu/sane

For 32bit Users:
Command : sudo cp /usr/lib/sane/libsane-brother* /usr/lib/i386-linux-gnu/sane