samba.gif (3150 bytes)

 
~ Installation with Miami

If not already done, create a permanent (e.g. in you user-startup) assign to your Miami directory. For example - 'assign Miami: work:net/miami/'.

Copy the Samba directory (and all sub-directories) extracted from the archive to 'Miami:'.

Add the line 'assign AmiTCP: Miami:' to your user-startup.

Install 'ixemul.library' v46.0 (or later) and 'ixnet.library' v46.0 (or later - currently comes in the ixemul archive) into 'libs:' This archive can be found in the util/libs/ directory on the Aminet - make sure you get the correct version for your processor!

You now need to make some additions to the Services and InetD databases that are stored within Miami's config. The easiest way to do this is to merge these files to the existing database by right-clicking (MUI GUI only I think) over the appropriate database page, selecting 'Merge with ASCII file' and then selecting the respective text file using the file requester. Of course you can add the entries by hand if you prefer.

Although quite logical, the next part may take a while to understand - especially for Win95/98 users who have no experience with Windows NT. When sharing a folder/drive with Win95/98 you are given the option to set up a password which is required in order to access that share. When you try and access that share across the network Win95/98 does not however care what your user name is, just as long as you know the correct password. Samba (like Windows NT) works on the principle that it will only allow you to access shares on the server if you are a known user, you have the correct password and that permission is given for you to access that share.There are some differences between Samba a Windows NT as Samba (by default) uses share level security and Windows NT user level security -   I don't however intend to explain the differences here. What you now need to do is add some users to the 'users' database in Miami. Be careful when clicking on enteries in the Miami database as an accidental double click can enable/disable users, groups, services etc!

For now I suggest you create 3 user accounts - one called 'user1', another called 'user2' and the last called 'guest'. Please note that case is sensitive! Enter them into the database as shown in the table below.

User name Password User id Group id Real name Home dir Shell
user1 workbench 501 101 User One ram: noshell
user2 workbench 502 101 User Two ram: noshell
guest (leave blank!) 500 100 Guest User ram: noshell


Important note - I have discovered that Samba always refers to user names in lower case. Therefore if you were to try and connect to a share as user 'Fred', Samba would think that you were 'fred'. This means that entries in the users database must always be in lower case.

Although not strictly necessary at this stage, add the following entries to the 'groups' database.

Group name Group id Users
users 101 (you can type the user names
guests 100 in here if you like)

Hopefully you can see that you now have users 'user1' and 'user2' in a group called 'users' and the 'guest' user in group called 'guests'. The reason for the groups (as far as Samba is concerned anyway) is that Samba can enable access to shares using either the user name or the group name (therefore enabling access for multiple users with a single entry).

On the TCP/IP page in Miami enter the name you want your computer to be known on the network as in the 'Host name' string gadget. For this exercise I suggest you call it 'Amiga' - this will become your NETBios name on the Windows PC. Enter your real name into the 'Real name' string gadget and 'user1' into the 'User name' string gadget. Please note that this is case sensitive! Although the last two settings are not critical if you only want to use Samba as a server, the user name setting is important if you want to act as a client and access shares on a PC running Windows NT (or possibly another other port of Samba).

What you now need to do is add the Amiga's name ('Amiga') and the PC or other SMB server name(s) to the 'hosts' database in Miami. These enteries are necessary for smbclient to work correctly. If you have configured your network as described elsewhere on this site then you will probably have these entries already, but just in case you don't now is the time to do it.

Temp IP address Name Aliases
  127.0.0.1 localhost  
  192.168.0.1 winpc  
  192.168.0.2 amiga  

If you have given the Amiga and PC different names to these, then substitute as required. As far as I know it is not necessary to add these entries to the HOSTS (e.g. C:\Windows\HOSTS or C:\WINNT\system32\drivers\etc\HOSTS) file on the PC. Personally I have not done this and have not noticed any problems. If you do experience problems accessing the Amiga using the NETBios name and have to keep using the IP address then maybe adding these will help.

In addition to username/password protectoin I suggest that you set up an IP filter to block access to ports 137 and 139 from anywhere other than from  your LAN, especially if you are using the Amiga as your gateway to the internet. To do this add the following enteries into Miami's 'IP filter' database.

Temp Protocol Service Host Mask Access Log
  * 137 192.168.0.*   y n
  * 139 192.168.0.*   y n
  * 137 *.*.*.*   n y
  * 139 *.*.*.*   n y

You now need to set up the shares on the Amiga - these are configured in the 'smb.conf' file that is in the samba/libs/ directory. I suggest (for now) you replace the existing file with this one which has been configured to work with the above settings. Load the file into a text editor (such as CygnusEd) and if required make some changes to the following lines (I have removed some other lines for clarity - do not delete them!):

workgroup = Workgroup ;This is the name of your workgroup, if you don't have one leave like this for now.
server string = Amiga A1200 ;This is the description of your computer that's shown in the Network Neighbourhood.

[ALL] ;This is the name of the share.
comment = All volumes in the system
;This is the comment (description) given for the share.
valid users = user1 user2
;Speaks for itself. Enables access to this share to 'user1' and 'user2'.
path = /
;This is the path that the share name gives access to. This share gives access to all volumes on your system - if on a 'public' network use this with caution! 
read only = yes
;Change 'no' to enable read/write access.
browseable = no
;This prevents the share from being listed in the Network Neighbourhood. Set to 'yes' if you want everyone to know that there's a share which gives access to you whole system!
write list = user1
;Although set to read only, this option overrides that setting and allows user1 to write to this share.

[RAM]
;This is the name of the share.
comment = Amiga RAM
;This is the comment (description) given for the share.
valid users = @users @guests
;As before, but in this example I have given access to groups of users (that's what the '@' signifies). It is possible to mix user and groups names - e.g. you could have 'user2 @guests' - therefore preventing 'user1' from accessing this share (bad example though as user1 is the local user anyway!) .
path = /RAM/
;Note the way in which the path is written - Samba (ixemul.library to be exact) does not like Amiga device names - e.g. 'RAM:'). To set up a share to give access to 'DH2:data/music/mods' the path statement should read 'path = /DH2/data/music/mods/'.
read only = yes ;There's no point in making the ram disk writeable as the SMB client always sees it as being full. Having said this, when mapped as a network drive the correct amount if free space is shown - even so you still can't write to it - weird!
browseable = yes
;Let's make the share visible to everyone.

The Amiga is almost ready, but before proceeding I suggest you re-boot (first making sure you've saved   smb.conf and your Miami config) in order to make the assigns added to your user-startup and to flush any old versions of
ixemul.library/ixnet.library that may already be resident in memory.

I suggest that the best way to start Samba and Miami is to launch a small AmigaDOS script. An example of such a script, looks like this (thanks to Ulf Bertilsson for the basis of this):

sys:rexxc/rx >nil: "if show(p,'MIAMI.1') then exit 5"
if $RC NOT EQ "0"
  echo "Miami is already running!"
  quit
endif

set TMPDIR "/T"
assign amitcp: miami:
run <>nil: miami:miami <>nil:
waitforport MIAMI.1
wait 2
run <> nil: amitcp:samba/bin/nmbd <>nil: -D -d 2
path amitcp:samba/bin add

There is one main limitation of using this script in that you must enable (don't forget to save the config again) the 'auto on-line' feature in Miami's events (something which I find annoying). In order to work round this 'problem' I tried to write an AmigaDOS/ARexx script pair that was a little more 'intelligent'. It does work, but for some reason (which I can't understand) when using these scripts, the first time I try and 'browse' the Amiga in the Network Neighbourhood I get told that the server is not configured for transactions (the same happens when trying to obtain a list of shares using smbclient)! If I connect to a share and then try and 'browse' the shares list everything is okay - weird! This problem does not occur when using the simple AmigaDOS script listed above. However if you want to try them out them click here to download. I'm going to keep looking into this, but if anyone else can offer an explanation (and preferably a solution) - please do :)

You will be relieved to know that configuration on the PC is much easier! The following assumes that you are running Win95/98, but NT4.0 is not so different and I guess if you are running NT then you have a good idea of what's what anyway?

Before we proceed I must bring to you attention a 'problem' regarding password encryption that prevents the Windows PC from accessing password protected shares. This affects everyone running Win95 OSR2 (possibly those running OSR1 with IE4?), Win98 and NT4SP3 or higher. For an explanation and a solution please read the 'Win95.txt' (this covers Win98 as well) and 'WinNT.txt' files that are found in the samba/docs/ dir. On a small (home) network then I guess password encryption is not a high priority and therefore this is probably not a big concern. For those on a larger network security may be more of an issue. Two possible solutions to this (haven't tried either of these myself) is to have a NT server controlling your domain and pass all password authentication over to it (see the 'security = server' option in smb.conf) or compile yourself a later version of Samba which supports encrypted passwords.

Right click on the 'Network Neighbourhood' icon on the desktop and select properties. Click the identification tab and enter the computers name as 'WinPC' (unless you've called it something different in the hosts database?), the workgroup as 'Workgroup' (change this if you did so in smb.conf on the Amiga) and enter a suitable description.

Unless you have a need for any protocol other than TCP/IP (such as NetBEUI or IPX/SPX) then remove them now. Assuming you've already installed and configured the TCP/IP network you should see the that TCP/IP is bound to your chosen network adapter. You need both 'File and printer sharing for Microsoft Networks' and 'Client for Microsoft Networks' installed. To do this click on the 'Add' button and select the first from 'Service' and the second from 'Client/Microsoft'. Ensure that both of these are checked in the 'Bindings' tab on your chosen network adapter.

Select 'Client for Microsoft Networks' as your Primary Network Logon and click 'OK' to close the 'Network' control panel. Windows will now re-start your computer. It is possible to use 'Windows Logon' as your Primary Network Logon, but this doesn't work that well when trying to access password protected (e.g. non guest) shares.   

When Windows re-starts it will now ask you for your username and password - enter 'user2' and 'workbench' respectively - please note that these are both case sensitive! Now set up a couple of shares on the PC by doing this (cut from the Windows help file):

  1. In Windows Explorer or My Computer, click the folder you want to share.
  2. On the File menu, click Properties.
  3. Click the Sharing tab, and then click Shared As.
  4. Click the Access Type you want, and, if necessary, enter a password.

If you have already started Miami/Samba on the Amiga, when double clicking on the Network Neighbourhood your should (hopefully!) see two computers listed - 'Amiga' and 'WinPC'. If they don't appear immediately then don't panic as it can take a minute or so for them to appear. When double clicking on the computers you should see a list of the shares available on that server. If you can't open the Amiga don't worry for now - I think this is quite common. With my old AmiTCP/Samba 1.9.16p9 I was lucky if I saw the Amiga in the Network Neighbourhood!

Select 'Run' from the start menu on the PC and type '\\Amiga\RAM'. Hopefully an explorer window will open showing the contents of the Amiga's ram disk. If it doesn't then try and connect using the IP address - e.g. type '\\192.168.0.2\RAM'. Win98 and other IE4 users can type these entries directly into the path (address) string in an explorer window.

If Windows prompts you for a password then you've probably logged on with the wrong username,  supplied an incorrect password or disabaled the account in Miami's database ;-) Try typing the password in again and if it works then you certainly did enter the wrong password at logon. If you've logged in with the wrong username then Windows will keep asking you over and over again for another password - give up now, you won't get in! Log off as the current user and log in as 'user2'. If this now works okay, try '\\Amiga\ALL' or '\\192.168.0.2\ALL' and with any luck you will see all the Amiga drives?

Although many things with Samba are case sensitive, I have found the neither NETBios names nor Samba (on the Amiga anyway - maybe other ports are different?) share names are. In the above example '\\amiga\all' works just the same. Likewise I have found that when using smbclient on the Amiga to access shares on localhost (in other words the Amiga) that the share name is not case sensitive. However share names on a Windows PC (I've only tried this with 95, 98 and NT4.0) are and are always UPPER CASE. If you get the case wrong you won't be told that the share doesn't exist! Keep this in mind when using both smbclient and smb-hander.

Lets suppose you set up a share on 'WinPC' called 'DATA'. To access this using smbclient type the following at the shell - 'smbclient \\winpc\DATA'. If you did not specify a password for this share then just press return when prompted, otherwise enter the correct password - yet again case sensitive! For non-password protected shares you can suppress the password prompt by adding the '-N' option - e.g. 'smbclient \\winpc\DATA -N'. When connection to share on a SMB server that cares what your username is (e.g. WinNT), smbclient obtains your username from the 'username' environmental variable. To double check your current username type 'echo $username' at the shell. This variable is   automatically set by Miami (based upon the 'User name' specified on the TCP/IP page).

When connected to a share using smbclient, there are probably 4 main commands to remember. These are 'dir' to list the current directories contents, 'cd' to change the current directory, 'get' to retrieve files and 'put' to upload files. A full explanation of how to use these commands can be found in the 'smbclient.txt' file in the samba/docs/ dir.

To obtain a list of shares on an SMB server type use the '-L' option - e.g. 'smbclient -L winpc' or 'smbclient -L amiga'. One thing I have found is that a NT server (this includes NT workstation) will not return a shares list unless you supply a valid username/password pair using the '-U' option. An example of this would be 'smbclient -L winpc -U user1%*****' (where ***** is the correct password). One solution could be to set up an account (maybe the guest account?) on the NT server that does not require a password, but has very limited (if any) rights. That way all users could obtain a shares list by typing 'smbclient -L winpc -U guest'.

~ Where next?

If you've got this far and now have a working Samba network then congratulations. I know it wasn't easy, but I'm sure you agree it was worth it? If it doesn't work then your best option would be to subscribe to the Amiga Samba mailing list (details on Rask's web site).

As well as file sharing Samba can provide other network functions such as printer sharing (something which I am yet to tackle) and the facility to send/receive WinPopUp messages. Sascha Pfalz has written a program for the Amiga to do the latter called AmiPopUp - for more information please take a look at http://www.in-berlin.de/User/siegel/. AmiPopUp only has a couple of small limitations that I know of. The first is that you can't send a message to a user (use the computer name) and the other is that you can't send a message to a workgroup. Otherwise it works just great !

If you are still after more information on Samba then the best bet is to search the web. One site I found quite interesting (although it is aimed at OS/2 users and has nothing to do with the Amiga) was http://carol.wins.uva.nl/~leeuw/samba/index.html. There is actually an installation guide for Samba with Miami on Nordic Global's web site - http://www.nordicglobal.com/MSamba.txt, but this is a little outdated (based upon an old port of Samba) and I can't say that I agree with it 101% - even so it may be of use. Another site which may be of interest is maintained by Ulf Bertilsson and can be found at http://www.geocities.com/TimesSquare/Arcade/6820/data/network.html.  

Once you've got Samba working I suggest you go back to the start, read through all the docs and slowly but surely it will all start to make some sense. Then why not experiment with some of the options? It's the only real way to learn in my option (for what it's worth).