<HTML>
<HEAD>
<TITLE>RISCOS Samba Server</TITLE>
</HEAD>
<BODY bgcolor=white text=black  LINK="#0000FF" VLINK="#8700BA" ALINK="#FF0000">
<H1 ALIGN=centre><IMG SRC="images/logo.jpg"> RISCOS Samba Server <IMG SRC="images/logo.jpg"></H1>
<P>
<A HREF="samba_03.htm"><IMG SRC="images/left.gif" ALIGH=LEFT BORDER=0></A> <A HREF="SAMBA.htm"><IMG SRC="images/cont.jpg" ALIGH=CENTRE BORDER=0></A> <A HREF="samba_05.htm" ALIGN=right><IMG SRC="images/right.gif"  ALIGN=RIGHT BORDER=0></A>  
<HR>

<H2><A NAME="remote">4 Connecting to !smbServer from remote machines</H2><P>
The machine running !smbserver is referred to as the server and the machines accessing it are referred to as the clients (or consumers). The clients need to know the name of the server machines. This is done by adding the name of the server to the client's host files. This is specified below.<P>
<H3><A NAME="unix">4.1 Unix / Linux</H3><P> 
<H4><A NAME="hostsu">4.1.1 Host names</H4><P>
Add the name of the server machine to /etc/hosts and /etc/lmhosts. The format is:
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr>
<td valign="top">
<PRE>
1.2.3.4       RiscPcName
</PRE> 
</td>
</tr>
</table>
Where 1.2.3.4 is the IP address of the server and RiscPcName is the name of the server to use in the commands below.
<P>
<H4><A NAME="smbclient">4.1.2 Smbclient</H4><P>
The following are brief examples of how to use smbclient and smbmount to access directories shared from an RISCOS machine running !smbserver. For more details see the relevant man pages.<P>
To view the shared services available: smbclient -L <machine name>
e.g.<P>
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr>
<td valign="top"><PRE>[david@merddin david]$ smbclient -L drhb1

Server=[DRHB1] User=[david] Workgroup=[DRHBNET] Domain=[DRHBNET]

    Sharename      Type      Comment
    ---------      ----      -------
    IPC$           IPC       IPC Service (Riscos Samba Server (RiscOs 4.02))
    photocd        Disk      Photo CD
    printers       Printer   All Printers
    Public         Disk      Public dir on Earl
    RamDisc        Disk      Test RISCS F+ format disk
    TestShare      Disk      Risc Pc
    TestX          Disk      Test export of X files dir

NOTE: There were share names longer than 8 chars.
On older clients these may not be accessible or may give browsing errors


This machine has a browse list:

    Server               Comment
    ---------            -------
    DRHB1                RiscOs Samba Server (RiscOs 4.02)
    MERDDIN              Samba 1.9.18p5


This machine has a workgroup list:

    Workgroup            Master
    ---------            -------
    DRHBNET              MERDDIN
[david@merddin david]$ 
</PRE></td></tr></table><P>
To connect to a share: smbclient //machine/sharename -N<BR> 
e.g.<BR>
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr>
<td valign="top">
<PRE>
[david@merddin david]$ smbclient //drhb1/TestShare -N
smb: \> pwd
Current directory is \\DRHB1\TESTSHARE\
smb: \>
</PRE>
</td>
</tr>
</table>
<P>
<H4><A NAME="smbmount">4.1.3 Smbmount and smbumount</H4><P>
Create a mount point for the share. E.g. /mnt/drhb1<BR>
<BR>
To mount a share: smbmount //machine/sharename<BR>
e.g.<BR>
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr>
<td valign="top">
<PRE>
smbmount //drhb1/TestShare /mnt/drhb1 -n -u 500 -g 500
</PRE>
</td>
</tr>
</table><BR>
The -u and -g give the user id and group id of the user on the UNIX machine that is going to access the share.<P>
<P>
To dismount a share: smbumount /mnt/mountname<BR>
e.g.<BR>
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr>
<td valign="top">
<PRE>
smbumount /mnt/drhb1
</PRE>
</td>
</tr>
</table>
<P>
If !smbserver is not using port 139 you can use the -p option of smbclient and smbmount to select the port number !smbserver is currently using.<P>
<P>
<H3><A NAME="wind">4.2 Windows 95/98</A></H3><P>
<P>
Add the name of the server to the hosts file \windows\hosts and \windows\lmhosts. The format is the same as in section <A HREF="#hostsu">4.1.1</A>. (There are two files in \windows called hosts.sam and lmhosts.sam. These are examples and can be copied as hosts and lmhosts respectively.) The server name added to the hosts files is the name to use in Windows when connecting to it.<P>
From an explorer window just type \\machine or \\machine\Sharename and away you go!<P>
<P>
<IMG SRC="images/image1.gif" ALIGN=centre>
<P>                                       
If passwords are enabled on a share then Windows may ask you for a password:<P>
<IMG SRC="images/pass.jpg" ALIGN=centre>
<P>
To map the share to a drive letter select Tools->Map Network Drive from Windows Explorer: <P>
<IMG SRC="images/image2.gif" ALIGN=centre>
<P>      <P>
Note that the RISCOS machine will <B>not</B> appear when you look at the neighbour hood network.<P>
<P>
<H3><A NAME="winPass">Passwords (Win95 and Win98)</A></H3><P>
Windows 98 and some versions of Windows 95 disables plain text (also called clear text) password authentication. The effects of this are desirable where MS Windows NT is providing the password authentication service. This is most undesirable where Samba must provide the authentication service unless Samba has been specifically configured to use encrypted passwords.
<P>
If the above conditions have not been complied with, and you are using Samba, then Windows 95 clients will NOT be able to authenticate to a Samba server.<P>
To re-enable plain text password capabilities AFTER applying this update you must create a new value in the Windows 95 registry.<P>
Either foillow the following procedure or just double click on the
file <A HREF="Win95_Pass.reg">Win95_PlainPassword.reg</A> for an easier way to do this.<P>
Procedure:<P>
<OL>
<LI>Launch the Registry Editor as follows:<BR>
Click on:	/Start/Run<BR>
Type "regedit" and press enter.<BR>
<LI>Double click on: <B>HKEY_LOCAL_MACHINE</B>
<LI>Locate the following Key:
<PRE>
/HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/VNETSUP
</PRE>
<LI>From the menu bar select Edit/New/DWORD Value
<LI>Rename the entry from "New Value #1" to:
EnablePlainTextPassword
<LI>Press Enter, then double click on the new entry. A dialog box will pop up and enable you to set a value. You must set this value to 1.
</OL>
<H3><A NAME="dos">4.3 DOS</A></H3><P>
<P>
Use the NET USE command. E.g.<BR>
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr>
<td valign="top"> net use f: \\drhb1\TestShare
</td></tr></table><P>
<P>
<H3><A NAME="risc">4.4 RISCOS</A></H3><P>
Add the name of the server you want to access to the hosts file of the RISCOS machine you are accessing the server from. The hosts file is usually $.!Boot.Resources.!Internet.files.Hosts but this is not always the case. Check the variable <B>InetDBase$Path</B> to find the hosts file. The format is the same as specified in <A HREF="#hostsu">4.1.1</A>. It is also a good idea to add the name of the server to its own hosts file. 
<P>
<H4><A NAME="omni">4.4.1 !Omniclient (and/or !LanMan98)</A></H4>
Use !OmniClient (or !LanMan98) to connect from another RISCOS machine in exactly the same way as you would do for a Windows machine. (I'm not sure why you would want to use LanMan instead of Access though!)<P>
<P>
!OmniClient will not connect to !smbserver when they are both running on the same machine. I don't know why this doesn't work. The Samba protocol is a client-sends-a-message, server responds protocol. If !OmniClient does not hand control back to RISCOS between sending a message and waiting for a response then this would explain why !smbserver never receives the message.<P>
<P>                 
<H4><A NAME="riscsmbclient">4.4.2 smbclient</A></H4>
<P>
The port of smbclient for RISCOS which is available from <A HREF="http://www.micros.hensa.ac.uk/">HENSA</A> (or <A HREF="http://sunsite.doc.ic.ac.uk/Mirrors/micros.hensa.ac.uk/local/riscos/">Sunsite</A>.) works exactly as described in section <A HREF="#smbclient">4.1.2</A>. Smbclient works when running on the same machine as !smbserver as well as on remote machines.<P>
<H3><A NAME="windNT">4.5 Windows NT</A></H3><P>
<H4><A NAME="windNTServer">4.5.1 Windows NT Server</A></H4><P>
<I>(Thanks to David Ramsden for providing these instructions.)</I><P>
How to setup NT Server 4 for use with the RISC OS SmbServer.<P>
If you have tried to setup NT Server 4 to access the RISC OS SmbServer and have troubles then this documentation will try and help you sort out your problems.<P>
Unlike Windows 95/98 where you set up a file called 'LMHosts' and 'Hosts' mapping the NetBIOS names to their respective IP addresses, NT Server 4 requires you to install the WINS (Windows Internet Name Service) server.<P>
To install the WINS server on NT Server 4 make sure you are logged in as the administrator and on the local domain, right click on the 'Network Neighborhood' icon and click on 'Properties' from the menu. Select the 'Services' tab. Click on the 'Add...' button. A window will appear with all the network servcies you can install. Scroll down to the bottom of the list and double click on  'Windows Internet Name Service' (located above'Workstation'). Place your Windows NT Server 4 CD-ROM in the drive and let it install the
files for the WINS.<P>
Now you need to click on the 'Protocols' tab and double click on 'TCP/IP Protocol'. Goto the 'WINS Address' tab and in the 'Primary WINS Server:' field enter in the IP address of your machine. <P>
<P>
Click the 'OK' button and then close the main window (click on the 'Close' button). Windows NT Server 4 will now ask you to reset your computer. Click 'Yes' to reset it.<P>
You may think that's it, but no it isn't. When NT has rebooted and you have logged back in (as the administrator) click on 'Start' and goto 'Programs' and then the 'Administrative Tools (Common) section. Load the 'WINS Manager' program.<P>
In the WINS Server should be your computers IP address. If it is not then click on the 'Server' menu and click on 'Add WINS Server...'. Add your WINS Server to the list. Now you need to click on the 'Mappings' menu and click on 'Static Mappings'.<P>

You need to make sure the RISC OS machine running SmbServer is turned on and is running SmbServer. On the static mappings window click on the 'Add Mappings' button. Enter in the RISC OS machines hostname running SmbServer (i.e shakespeare) and then enter in the IP address of the RISC OS machine running SmbServer (i.e. 10.1.1.60). Click on the close button. In the static mappings window the computer you just entered should appear. Click close on that window.<P>

Exit from the WINS Manager program. You now should be able to connect to your RISC OS machine. For some reason, unlike Windows 95/98 you can not click on Run (from the start menu) and go straight to the RISC OS machine (e.g. \\shakespeare\network). <P>

You need to enter the command prompt (type cmd in the run dialog box). Type in:
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr><td valign="top"><PRE>net use x: \\computername\share</PRE></td></tr></table><P>

Where x: is, is the network drive you wish to use. Where computername is, is the name of the RISC OS machine running SmbServer (the one you just entered into the WINS Server), and where share is, is the name of the share. For example to connect to my RISC OS machine running SmbServer and connect to the share called 'harddrive' I would enter (in the command prompt): 
<table cellpadding="0" cellspacing="0" border="0" bgcolor=#ddffdd width=100%>
<tr><td valign="top"><PRE>net use s: \\shakespeare\harddrive</PRE><P></td></tr></table><P>

If all has gone well, it should all work. If you have any problems please contact me (David Ramsden) via david@teletec.u-net.com but I am not resbonsible for SmbServer itself.<P>  

<H4><A NAME="windNTClient">4.5.2 Windows NT Client</A></H4><P>
<I>(Thanks to Dick Morris for this information.)</I><P>
First of all you need to set up the NT box. Go to the Network
Neighbourhood's Properties dialog, choose the WINS Address tab, tick
Enable LMHosts Lookup and click on the Import LMHosts button. Note that
the LMHosts file is in C:\Winnt\System32\Drivers or something like that.
If that does not work then copy the file LMHosts into C:\Winnt\System32
which is the directory that is opened when you click on the Import
LMHosts button.<P>
Trying to open a window in Explorer using just the
host name (e.g. \\rheinfels) as suggested above does not work
- it just gives a 'network name not accessible' error or something like
that. If the share name is specified as well (\\rheinfels\helford) then it
will open the root directory on Helford but won't allow access  to any
subdirectories. However, mapping each share to a drive number (with Explorer
or NET USE) and using that everything seems to work.
<P>
<H3><A NAME="winNTpass">4.5.3 Windows NT Passwords</A></H4><P>
All versions of Windows NT prior to 4.0 Service Pack 3 could negotiate plain text (clear text) passwords. Windows NT 4.0 Service Pack 3 changed this default behaviour so it now will only handle encrypted passwords. The following registry entry change will re-enable clear text password handling:<P>
Run regedt32.exe and locate the hive key entry:<BR>
<PRE>
HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\Rdr\Parameters\
</PRE><P>
Add the following value:<BR>
<PRE>
EnablePlainTextPassword:REG_DWORD=1
</PRE><P>
Alternatively, use the <A HREF="NT4_Pass.reg">NT4_PlainPassword.reg</A> file  (either by double clicking on it, or run regedt32.exe and select "Import Registry File" from the "Registry" Menu).
<P>
<HR>
<A HREF="samba_03.htm"><IMG SRC="images/left.gif" ALIGH=LEFT BORDER=0></A> <A HREF="SAMBA.htm"><IMG SRC="images/cont.jpg" ALIGH=CENTRE BORDER=0></A> <A HREF="samba_05.htm" ALIGN=right><IMG SRC="images/right.gif"  ALIGN=RIGHT BORDER=0></A>  
<P>
<I>RISCOS Samba Server</I>
</BODY>
</HTML>
