Setup Samba Server on Ubuntu (Feisty Fawn)

1.install samba
sudo apt-get install samba

2.stop samba service, so that we can do configuration
sudo /etc/init.d/samba stop

3.configure samba
sudo gedit /etc/samba/smb.conf

4.setup share folder in smb.conf
add this at the end of smsb.conf
[SHARE]
path = /var/lib/share ;share directory
browseable = yes ;browseable
read only = no ;readonly
create mask = 0644 ;file creation mask
directory mask = 0755 ;directory creation mask

5. login setting
Default setting use linux user account to login, root is forbidden
in smb.conf
security = user
invalid users = root
you can share without login by setting
sercurity = share

6.start samba service
sudo /etc/init.d/samba start

6.create samba account
sudo smbpasswd -a [linuxUsername]

If you just want to share file between your linux and windows machine in your home like me.

Here is my handy setting :
security = share

[share]
path = [share folder path]
read only = no
writable = yes
browseable = yes
guest ok = yes

and then change that folder setting :
owner = nobody
folder = create and delete
file = read and write
group = nogroup
folder = create and delete
file = read and write

Advertisements

Install JDK on Linux (CentOS)

1. download the .bin runnable file from sun.
2. use chmod and change the .bin to executable mode.
3. run it. example: ./jdk1.6.0_06.bin

and then it will install itself.

But CentOS use redhat jdk under /usr/bin/java
you can check it with this command: which java
To change this environment setting for bash shell, add this to your [userhome]/.bashrc

export PATH=/[javahome]/bin:$PATH
export JAVA_HOME=”/[javahome]”

if you install your jdk to /root/jdk1.6.0_06, the result will be
export PATH=/root/jdk1.6.0_06/bin:$PATH
export JAVA_HOME=”/root/jdk1.6.0_06″

beware the difference between linux and windows (since I am windows user).
windows use “;”, linux use “:”