Installation and configuration of Samba on AIX 5.2 and above

Download the packages

Download the latest samba binary packages, at the time of writing they were available here

You will need the latest version, something like the following opt-samba-3.0.26a-AIX5.tar.gz

You will also need the base package, something like the following opt-samba-base.tar.gz

Install the packages

Once downloaded and on the server decompress the packages as follows gunzip opt-samba-base.tar.gz, do the same for the other package

Then extract the packages as follows tar xvf opt-samba-base-AIX5.tar, do the same for the other package

Read the license agreement installp -lE -d. (don't forget the dot after -d)

Install the packages installp -agYX -d. all (don't forget the dot after -d)

Once the packages are installed you will need to create a samba configuration file in the standard directory for this file. In this case the directory is /opt/pware/samba/3.0.26a/lib. The file is called smb.conf

You can use an example file as a template, I found one in the directory /opt/pware/samba/3.0.26a/examples/dce-dfs. Copy this file to /opt/pware/samba/3.0.26a/lib

Modify this configuration file as needed

For a basic directory share add something like the following


comment = Shared directory

path = /share

valid users = bert alfred

read list = bert

public = yes

writable = yes

printable = no

And comment out anything not required

Starting samba

Now start the samba processes

As root type the following /opt/pware/samba/3.0.26a/sbin/nmbd -D

And /opt/pware/samba/3.0.26a/sbin/smbd -D

Testing samba

Run the commands smbstatus, testparm and smbclient -L localhost, just hit return at the password prompt

And thats it, samba should now be working on your AIX server

Starting samba on boot - Method 1 - Using the System Resource Controller (SRC)

SRC is a central daemon process that controls the functions of other system daemons

The subsystems that are currently controlled by the SRC can be seen using the command lssrc -a

To configure samba as a SRC subsystem use the following two commands

/usr/bin/mkssys -s nmbd -p /opt/pware/samba/3.0.26a/sbin/nmbd -a '-F -s /opt/pware/samba/3.0.26a/lib/smb.conf' -u 0 -S -n 15 -f 9 -R -G samba

/usr/bin/mkssys -s smbd -p /opt/pware/samba/3.0.26a/sbin/smbd -a '-F -s /opt/pware/samba/3.0.26a/lib/smb.conf' -u 0 -S -n 15 -f 9 -R -G samba

Type lssrc -a again to ensure the two samba processes "smbd" and "nmbd" are running and active

Samba can now be started and stopped using the following commands

startsrc -g samba

stopsrc -g samba

Now to ensure that samba starts automatically at boot, type the following command to add an entry to /etc/inittab

mkitab "samba:2:once:/usr/bin/startsrc -g samba > /dev/console 2>&1"

Type lsitab -a to check that a line for samba has been added correctly

The script /usr/sbin/shutdown that is used to shutdown the server, has already got code in place to shutdown all SRC subsystems. So samba shutdown is already taken care of

And that's it, give it a test

Starting samba on boot - Method 2 - Using a startup script

Type /usr/sbin/mkitab 'samba:2:once:/etc/rc.samba > /dev/console' to create an entry in /etc/inittab to run /etc/rc.samba on boot

Now create the file /etc/rc.samba and add the following

if [ -f /opt/pware/samba/3.0.26a/sbin/nmbd ]; then

/opt/pware/samba/3.0.26a/sbin/nmbd -D


if [ -f /opt/pware/samba/3.0.26a/sbin/smbd ]; then

/opt/pware/samba/3.0.26a/sbin/smbd -D


Don't forget to give the file execute permissions

Type chmod 755 /etc/rc.samba

And now samba should start at boot, give it a test

Creating Samba users

Firstly create a unix user with the same name as the required samba user

Then create a new samba user with the same name as the unix user

To create the samba user type the following /opt/pware/samba/3.0.26a/bin/smbpasswd -a "username", where "username" is the unix username already created, and create a password when prompted