Wednesday, August 11, 2010

Project - Samba: Checklist

11 things to check before putting Samba server to work:

1 - smb.conf

$ testparm /etc/smb.conf

2 - connection: ping

$ ping mfhk-riverliu

If return ‘host not found’ or a similar message, then your DNS software or /etc/hosts file is not correctly set up.

Elseif other ping errors, go to check 3 - the firewall.

C:\> ping test-samba

$ hostname
$ hostname -a
$ hostname -f

3 - firewall

$ iptables -L -v
$ ipchains -L -v

4 - List shares from Samba server

$ smbclient -L test-samba

If you get an error message containing the string ‘bad password’, then you probably have either an incorrect hosts allow, hosts deny, or valid users line in your smb.conf, or your guest account is not valid. Check what your guest account is using testparm and temporarily remove any incorrect hosts allow, hosts deny, or valid users lines.

If you get a message connection refused response, then the smbd server may not be running. If you installed it in inetd.conf, then you probably edited that file incorrectly. If you installed it as a daemon, then check that it is running and check that the netbios-ssn port is in a LISTEN state using netstat -a.

Note: Some UNIX/Linux systems use xinetd in place of inetd. Check your system documentation for the location of the control files for your particular system implementation of the network super daemon.

...

5 - Return IP of Samba server

$ nmblookup -B test-samba __SAMBA__

6 - Return IP of Samba client

$ nmblookup -B mfhk-riverliu "*"

7 - Query boardcast

$ nmblookup -d 2 "*"

8 - Enter share

$ smbclient //test-samba/share-name

9 - net view

C:\> net view \\test-samba

10 - net use

C:\> net use \\test-samba\share-name

11 - Return IP of master browser of workgroup

$ nmblookup -M workgroup-name

More ...

Monday, August 9, 2010

Add "read more" in Blogger

Usually Blogger shows the whole post on main page by default. It is quite annoying, especially when I post a long document describing something like Samba configuration.

I searched the internet for solution of showing the start of post on main page. Some were quite good, but still not perfect when dueling with the customized pages. That is the reason for me to write this solution:

Point to Design | Edit HTML. Check Expand Widget Templates.

Inside the HTML box, there should be a line like

<data:post.body/>

replace this line with

<b:if cond='data:blog.pageType != "static_page"'>
    <b:if cond='data:blog.pageType == "item"'>
        <style>.fullpost{display:inline;}</style>
        <data:post.body/>
    <b:else/>
        <style>.fullpost{display:none;}</style>
        <p><data:post.body/>
            <b:if cond='data:post.url'>
                <a expr:href='data:post.url'>More ...</a>
            <b:else/>
                <data:post.title/>
            </b:if>
        </p>
    </b:if>
<b:else/>
    <data:post.body/>
</b:if>

Then save this template.

Point to Setting | Formatting . Add this line to Post Template:

<div class="fullpost"></div>

For each post, the "more" part should be enclosed within the div shown above.

More ...

Biweekly Report - Report 5

26 Jul 2010 – 6 Aug 2010

1. Things I did:

In the first week, I began with re-design the Information Collector I started a few weeks ago. Then I was introduced to a new project to construct a file server for Guangzhou office with Samba, an open source package for file sharing and security control. I studied it for days, to get familiar with its features, functions and usages. Then I built a Samba server on Debian Linux system (Ubuntu 10.04 LTS) for testing and configured basic setting by the end of this week.

In the second week, I continued with the Samba server I built last week. I focused on its security issues, accessibility and networking this time. Also I went through the official guide HOWTO of more than 540 pages and the official example book ByExampleof more than 640 pages to be able to use the Samba under various conditions.

2. Things I learnt

Although I had been working on Linux system for years, it was the first time for me to know about Samba, and lots of relative terminologies, like NetBT, NetBIOS, SMB, CIFS and Opportunistic locking. During the Samba server testing, I also had a better understanding of Linux-Windows interaction and NT domain.

The other skill I improved was time management. It was always a good practise to retrive useful information from large amount of data in limited time.

3. Expectations

I wish to continue to work on Samba server, especially on method to map Windows NT accounts to Unix accounts, so that Windows NT users no longer need to have separate accounts on the Samba server.

Also I wish to install the file server system for Guangchou office in real sitaution in the following two weeks before the end of my internship.

More ...