1.de EX 2.nr x \\$1v 3\\!h0c n \\nx 0 4.. 5.de FG \" start figure caption: .FG filename.ps verticalsize 6.KF 7.BP \\$1 \\$2 8.sp .5v 9.EX \\$2v 10.ps -1 11.vs -1 12.. 13.de fg \" end figure caption (yes, it is clumsy) 14.ps 15.vs 16.br 17\l'1i' 18.KE 19.. 20\" step numbers 21.nr ,s 0 1 22.af ,s a 23.am NH 24.nr ,s 0 1 25.. 26.de Sn \" .Sn "step" 27•\ Step \\n(H1\\n+(,s: \\$1 28.. 29.de Ss 30.P1 31.B 32.Sn "\\$1" 33.P2 34.. 35.TL 36Installing the Inferno Software 37.AU 38Vita Nuova 39.br 40support@vitanuova.com 41.br 4212 June 2003 43.SP 4 44.LP 45Inferno can run as either a native operating system, in the usual way, or as a 46.I hosted 47virtual operating system, 48running as an application on another operating system. 49This paper explains how to install Inferno from the distribution media 50to a hosted environment and how to configure the system for 51basic networking. 52.LP 53Inferno can run as a hosted virtual operating system on top of 54Plan 9, Unix or Windows. 55In this paper, the term 56.I Unix 57is used to cover all supported variants, currently FreeBSD, Linux, HP/UX, Irix and Solaris, 58and the term 59.I Windows 60covers Microsoft Windows (98, Me, Nt, 2000, and XP). 61(Windows 98 might first require installation of the Unicode layer update from Microsoft.) 62.NH 63Preparation 64.LP 65You should ensure at least 150 Mbytes of free space on the filesystem. 66The installation program will copy files from the distribution CD to a 67directory on the filesystem called the 68.I inferno_root 69directory. 70You can choose the location of this directory. 71If you are installing to a multiuser filesystem outside your control a subdirectory of your home 72directory might be most sensible. If you plan to share the Inferno 73system with other users then common choices for 74.I inferno_root 75are 76.CW /usr/inferno 77on Unix and Plan 9 systems, and 78.CW c:\einferno 79on Windows systems. 80Where these appear in examples in this paper you should substitute 81your own 82.I inferno_root 83directory. 84.Ss "Choose the \fIinferno_root\fP directory." 85Ensure that the user who will run the installation program has 86appropriate filesystem permissions to create the 87.I inferno_root 88directory and 89files and subdirectories beneath it. 90.NH 91Copying Files 92.LP 93On all platforms the files will be owned by the user doing the installation, 94except for installation onto a FAT file system (eg, on Windows), where the files 95appear to be owned by 96.CW Everyone 97because FAT does not record ownership. 98.Ss "Insert the distribution CD into the CD drive." 99On Unix and Plan 9, 100mount the CD to a suitable location on the filesystem, call this location 101.I cd_path . 102On Windows, note the drive letter of the CD, call this drive letter 103.I cd_drive . 104The files will be copied by an Inferno hosted installation program which runs 105directly from the CD. 106The directory 107.CW /install 108on the CD contains an installation program for each supported platform \- a shell 109script for Unix and Plan 9 and an executable for Windows. 110The Plan 9 install script is called 111.CW Plan9.rc 112and determines the CPU type from the environment variable 113.CW cputype . 114The Unix install scripts all have names of the form 115.CW \fIhost_os\fP-\fIhost_arch\fP.sh 116where 117.I host_os 118will be one of: 119.CW FreeBSD , 120.CW Linux , 121or 122.CW Solaris 123and 124.I host_arch 125will be one of: 126.CW 386 , 127.CW mips , 128.CW power 129or 130.CW sparc . 131Most platforms offer just the one obvious combination. 132The Windows installation program is called 133.CW setup.exe ; 134it is used on all varieties of Windows. 135The next step describes how to begin the installation by running the program 136that corresponds to your host system. 137.Ss "Run the installation script." 138The installation program will copy files from the CD to the filesystem. 139The Windows installation program will also create registry entries and add 140an Inferno item to the Windows 141.I start 142menu. 143On Plan 9, run 144.P1 145rc \fIcd_path\fP/install/Plan9.rc \fIinferno_root\fP 146.P2 147Where 148.I inferno_root 149is the path to the chosen Inferno root directory. The CPU architecture 150will be inferred from the environment variable 151.CW cputype . 152On Unix, run 153.P1 154sh \fIcd_path\fP/install/\fIhost-os\fP-\fIhost_arch\fP.sh \fIinferno_root\fP 155.P2 156Where 157.I host_os 158is the Unix variant name 159.CW FreeBSD , ( 160.CW Irix , 161.CW Linux 162or 163.CW Solaris ). 164.I host_arch 165is the CPU type (eg, 166.CW 386 ), 167and 168.I inferno_root 169is the path to the chosen Inferno directory. 170On Windows, run 171.P1 172\fIcd_drive\f(CW:\einstall\esetup.exe 173.P2 174The Windows installation program will ask you to choose the location of the installation 175directory on the hard disk. 176.LP 177On all platforms, a copy of Inferno 178on the CD will install from various installation packages on the CD to the 179.I inferno_root 180subtree on the filesystem. 181On any platform it installs support for all. 182.LP 183Inferno is now installed, but it needs to be configured 184for your site. 185The process acts as a quick tour of parts of the system. 186The main tasks are to add local parameters to the network data base, 187and to set up the authentication system. 188If you are going to run Inferno standalone, for instance to experiment with Limbo 189and the file serving interface, 190most of what follows can be deferred indefinitely. 191It is still worthwhile skimming through it, because the first few sections tell how 192to start up Inferno with correct parameters (eg, root directory and graphics resolution). 193(A configuration program that runs under the window system would be more convenient, 194and fairly easy to do, but that has not yet been done.) 195.NH 196Running Inferno 197.LP 198Inferno host executables are all kept in a single directory corresponding 199to the combination of host operating system and CPU architecture \- the Inferno 200.CW bin 201directory. 202.P1 203\fIinferno_root\fP/\fIhost_os\fP/\fIhost_arch\fP/bin 204.P2 205(On Windows the path might need 206.CW \e 207not 208.CW / 209of course.) 210That directory can be added to the search path of the host system's command interpreter, 211and that process will be described first, although as discussed later one can use a script 212instead and that is sometimes more convenient. 213(Of course, the script will still need to refer to that directory.) 214.LP 215.I "Plan 9:\ \ " 216Plan 9 users should add a line to their 217.CW lib/profile 218file that binds this directory after their 219.CW /bin 220directory. 221.P1 222bind -a /usr/inferno/Plan9/$cputype/bin /bin 223.P2 224The bind is done after the existing 225.I bin 226directory to avoid hiding the existing Plan 9 compilers. 227If, at a later stage, you build either the hosted or native Inferno kernels for ARM or StrongARM 228you should ensure that the Inferno compilers are used rather than 229the Plan 9 compilers, since they differ in the implementation of 230floating-point instructions (the Plan 9 ARM suite uses a byte order that is more plausible 231than the order ARM dictates but therefore wrong). 232That difference is likely to be resolved at some point but it has not yet been done. 233.LP 234.I "Windows:\ \" 235The 236.I host_os 237is always 238.CW Nt 239(even for Windows 98, 2000 or XP) 240and 241.I host_arch 242is always 243.CW 386 244and the installation program will create an entry on the 245.I "start menu" 246to invoke Inferno. 247For Unix systems or Windows systems in which Inferno will be started 248from a command shell, the environment variable 249.CW PATH 250should be set to include the Inferno 251.CW bin 252directory. 253For Windows 95 and Windows 98 this should be done in the 254.CW \eautoexec.bat 255file by adding a line like 256.P1 257PATH=c:\einferno\eNt\e386\ebin;%PATH% 258.P2 259You will need to reboot Windows to have the system reread the 260.CW \eautoexec.bat 261file. 262For Windows NT and Windows 2000 modify the 263.CW Path 264environment variable through 265.I "Control Panel -> System -> Environment" . 266.LP 267If you are using an MKS or Cygwin Unix-like shell environment, 268you might instead set: 269.P1 270PATH="c:/inferno/Nt/386/bin;$PATH" 271.P2 272and export it if necessary. 273.LP 274.I "Unix:\ \" 275For Unix systems, for 276.CW sh 277derivatives, the environment variable 278.CW PATH 279should be set to include the Inferno 280.CW bin 281directory. 282This might be done in your 283.CW .profile 284file by adding a line like 285.P1 286PATH="/usr/inferno/Linux/386/bin:$PATH" 287.P2 288Don't forget to ensure that 289.CW PATH 290is exported. 291You may need to log out and back in again for the changes to take effect. 292.KS 293.Ss "Start Inferno." 294Hosted inferno is run by invoking an executable called 295.I emu . 296.KE 297On Windows, select the Inferno option from the 298.I "start menu" . 299This will invoke 300.I emu 301with appropriate arguments to find its files in 302.I inferno_root . 303If you need to change any of the options passed to 304.I emu 305when invoked from the 306.I "start menu" 307you need to do this by clicking the right mouse button 308on the Windows task bar and choosing 309.I "Properties -> Start Menu Programs -> Advanced" 310to modify the shortcut used for Inferno. 311For Unix and Plan 9, you will need to tell 312.I emu 313where to find the Inferno file tree by passing it the 314.CW -r\fIrootpath\f(CW 315command line option. For example 316.P1 317emu -r/usr/john/inferno 318.P2 319Without the 320.CW -r 321option it will look for the file tree in 322.CW /usr/inferno 323on Plan 9 and Unix and, when invoked from the command line on WIndows, 324the default is 325.CW \einferno 326on the current drive. 327(The Windows start menu by contrast has already been set to use the right directory by the installation software.) 328.LP 329When using graphics, 330.I emu 331will use a window with a resolution of 640 x 480 pixels by default. To use a larger resolution 332you will need to pass 333.I emu 334an option 335.CW -g\fIXsize\f(CWx\fIYsize\f(CW 336on the command line. So, for example, to invoke 337.I emu 338as above but with a resolution of 1024 x 768 pixels the full command line 339would be 340.P1 341emu -r/usr/john/inferno -g1024x768 342.P2 343When invoked in this way 344.I emu 345displays a command window running the Inferno shell 346.CW /dis/sh.dis . 347To avoid typing the command line options each time you invoke 348.I emu 349you can store them in the environment variable 350.CW EMU 351which is interrogated when 352.I emu 353is started and might as well be set along side the 354.CW PATH 355environment variable if the same configuration options are to be used on 356each invocation. 357.P1 358set EMU="-rd:\eDocuments and Settings\ejohn\einferno -g1024x768" 359.P2 360for Windows. 361.P1 362EMU=(-r/usr/john/inferno -g1024x768) 363.P2 364for Plan 9, and 365.P1 366EMU="-r/usr/john/inferno -g1024x768" 367.P2 368for Unix. 369An alternative to using the 370.CW EMU 371environment variable is to place the correct invocation in a 372script file (or batch file, for Windows) and invoke that instead 373of running 374.I emu 375directly. 376It is important to note that for Windows the 377.CW -r 378option also serves to indicate both the drive and directory on to which the software 379has been installed. Without a drive letter the system will assume the 380current drive and will fail if the user changes to an alternative drive. 381Once the environment variables or scripts are set up, as described above, invoking plain 382.P1 383emu 384.P2 385or the appropriate script file, 386should result in it starting up Inferno's command interpreter 387.I sh (1), 388which prompts with a semicolon: 389.P1 390; 391.P2 392You can add a further option 393.CW -c1 394to start up 395.I emu 396in a 397mode in which the system compiles a module's 398Dis operations to native machine instructions when a module 399is loaded. 400(See the 401.I emu (1) 402manual page.) 403In 404.I compile 405mode programs that do significant computation will run much faster. 406Whether in compiled or interpreted mode you should now have a functional 407hosted Inferno system. 408When Inferno starts the initial 409.CW /dis/sh.dis 410it reads commands from the file 411.CW /lib/sh/profile 412before becoming interactive. See the manual pages for the shell 413.I sh (1) 414to learn more about tailoring the initial environment. 415.LP 416The semicolon is the default shell prompt. From this command window 417you should be able to see the installed Inferno files and directories 418.P1 419lc / 420.P2 421The command 422.I lc 423presents the contents of its directory argument in columnar fashion to standard 424output in the command window. 425.P1 426; lc / 427FreeBSD/ Unixware/ icons/ libkern/ man/ prof/ 428Hp/ acme/ include/ libkeyring/ mkconfig prog/ 429Inferno/ appl/ keydb/ libmath/ mkfile services/ 430Irix/ asm/ legal/ libmemdraw/ mkfiles/ tmp/ 431LICENCE chan/ lib/ libmemlayer/ mnt/ tools/ 432Linux/ dev/ lib9/ libtk/ module/ usr/ 433MacOSX/ dis/ libbio/ licencedb/ n/ utils/ 434NOTICE doc/ libcrypt/ limbo/ net/ wrap/ 435Nt/ emu/ libdraw/ locale/ nvfs/ 436Plan9/ env/ libfreetype/ mail/ o/ 437Solaris/ fonts/ libinterp/ makemk.sh os/ 438; 439.P2 440Only the files and directories in and below the 441.I inferno_root 442directory on the host filesystem are immediately visible to an Inferno process; 443these files are made visible in the root of the Inferno file namespace. 444If you wish to import or export files 445from and to the host filesystem you will need to use tools on your 446host to move them in or out of the Inferno visible portion of your host 447filesystem (see the manual pages 448.I os (1) 449and 450.I cmd (3) 451for an interface to host commands). 452(We plan to make such access direct, but the details are still being worked out.) 453From this point onwards in this paper all file paths not qualified with 454.I inferno_root 455are assumed to be in the Inferno namespace. 456Files created in the host filesystem will be created with the user id of 457the user that started 458.I emu 459and on Unix systems with that user's group id. 460.NH 461Setting the site's time zone 462.LP 463Time zone settings are defined by 464files in the directory 465.CW /locale . 466The setting affects only how the time is displayed; the internal representation does not vary. 467For instance, the file 468.CW /locale/GMT 469defines Greenwich Mean Time, 470.CW /locale/GB-Eire 471defines time zones for Great Britain and the Irish Republic 472(GMT and British Summer Time), and 473.CW /locale/US_Eastern 474defines United States 475Eastern Standard Time and Eastern Daylight Time. 476The time zone settings used by applications are read 477(by 478.I daytime (2)) 479from the file 480.CW /locale/timezone , 481which is initially a copy of 482.CW /locale/GB-Eire . 483If displaying time as the time in London is adequate, you need change nothing. 484To set a different time zone for the whole site, 485copy the appropriate time zone file into 486.CW /locale/timezone : 487.P1 488cp /locale/US_Eastern /locale/timezone 489.P2 490To set a different time zone for a user or window, 491.I bind (1) 492the file containing the time zone setting over 493.CW /locale/timezone , 494either in the user's profile or in a name space description file: 495.P1 496bind /locale/US_Eastern /locale/timezone 497.P2 498.NH 499Running the 500Window Manager 501.I wm 502.LP 503Graphical Inferno programs normally run under the window manager 504.I wm (1). 505Inferno has a simple editor, 506.I wm/edit , 507that can be used to edit the inferno configuration files. 508The `power environment' for editing and program development is 509.I acme (1), 510but rather that throwing you in at the deep end, we shall stick to 511the simpler one for now. 512If you already know Acme from 513Plan 9, however, or perhaps Wily from Unix, feel free to use Inferno's 514.I acme 515instead of 516.I edit . 517.Ss "Start the window manager." 518Invoke 519.I wm 520by typing 521.P1 522wm/wm 523.P2 524You should see a new window open with a blue-grey background and a small 525.I "Vita Nuova" 526logo in the bottom left hand corner. Click on the logo with mouse button 1 527to reveal a small menu. 528Selecting the 529.I Edit 530entry will start 531.I wm/edit . 532In common with most 533.I wm 534programs the editor has three small buttons in a line at its top right hand corner. 535Clicking on the X button, the rightmost button, 536will close the program down. The leftmost of the three buttons will allow the window 537to be resized \- after clicking it drag the window from a point near to either one of its 538edges or one of its corners. The middle button will minimise the window, creating 539an entry for it in the application bar along the bottom of the main 540.I wm 541window. You can restore a minimised window by clicking on its entry in the application bar. 542The initial 543.I wm 544configuration is determined by the contents of the shell 545script 546.CW /lib/wmsetup 547(see 548.I toolbar (1) 549and 550.I sh (1)). 551.Ss "Open a shell window." 552Choose the 553.I shell 554option from the menu to open up a shell window. The configuration of Inferno 555will be done from this shell window. 556.NH 557Manual Pages 558.LP 559Manual pages for all of the system commands are available from a shell 560window. Use the 561.I man 562or 563.I wm/man 564commands. For example, 565.P1 566man wm 567.P2 568will give information about 569.I wm . 570And 571.P1 572man man 573.P2 574will give information about using 575.I man . 576.I Wm/man 577makes use of the Tk text widget to produce slightly more 578attractive output than the plain command 579.I man . 580Here, and in other Inferno documentation you will see references to manual page 581entries of the form \fIcommand\f(CW(\fIsection\f(CW)\fR. 582You can display the manual page for the command by running 583.P1 584man \fIcommand\fP 585.P2 586or 587.P1 588man \fIsection\fP \fIcommand\fP 589.P2 590if the manual page appears in more than one section. 591.NH 592Initial Namespace 593.LP 594The initial Inferno namespace is built 595by placing the root device '#/' (see 596.I root (3)) 597at the root of the namespace and binding 598.nr ,i 0 1 599.af ,i i 600.IP \n+(,i) 601the host filesystem device '#U' (see 602.I fs (3)) 603containing the 604.I inferno_root 605subtree of the host filesystem at the root of the Inferno filesystem, 606.IP \n+(,i) 607the console device '#c' (see 608.I cons (3)) 609in 610.CW /dev , 611.IP \n+(,i) 612the prog device '#p' (see 613.I prog (3)) 614onto 615.CW /prog , 616.IP \n+(,i) 617the IP device '#I' (see 618.I ip (3)) 619in 620.CW /net , 621and 622.IP \n+(,i) 623the environment device '#e' (see 624.I env (3)) 625at 626.CW /dev/env . 627.rr ,i 628.LP 629You can see the sequence of commands required to construct the current namespace 630by running 631.P1 632ns 633.P2 634.NH 635Inferno's network 636.LP 637If you are just going to use Inferno for local Limbo programming, and not use its 638networking interface, you can skip to the section ``Adding new users'' at the end of this document. 639You can always come back to this step later. 640.LP 641To use IP networking, the IP device 642.I ip (3)) ( 643must have been bound into 644.CW /net . 645Typing 646.P1 647ls -l /net 648.P2 649(see 650.I ls (1)) 651should result in something like 652.P1 653--rw-rw-r-- I 0 network john 0 May 31 07:11 /net/arp 654--rw-rw-r-- I 0 network john 0 May 31 07:11 /net/ndb 655d-r-xr-xr-x I 0 network john 0 May 31 07:11 /net/tcp 656d-r-xr-xr-x I 0 network john 0 May 31 07:11 /net/udp 657.P2 658There might be many more names on some systems. 659.LP 660A system running Inferno, whether native or hosted, can by agreement attach to any or all resources that 661are in the name space of another Inferno system (or even its own). 662That requires: 663.IP • 664the importing system must know where to find them 665.IP • 666the exporting system must agree to export them 667.IP • 668the two systems must authenticate the access (not all resources will be permitted to all systems or users) 669.IP • 670the conversation can be encrypted to keep it safe from prying eyes and interference 671.LP 672On an Inferno network, there is usually one secure machine that acts as authentication server. 673All other systems variously play the rôles of server and client as required: any system can import some resources (or none) 674and export others (or none), simultaneously, and differently in different name spaces. 675In following sections, we shall write as though there were three distinct machines: 676authentication server (signer); server (exporting resources); and client (importing resources). 677With Inferno, you can achieve a similar effect on a single machine by starting up distinct 678instances of 679.I emu 680instead. 681That is the easiest way to become familiar with the process (and also avoids having to install 682the system on several machines to start). 683It is still worthwhile setting up a secured 684authentication server later, especially if you are using Windows on a FAT file system 685where the host system's file protections are limited. 686.LP 687We shall now configure Inferno to allow each of the functions listed above: 688.IP • 689change the network database to tell where to find local network resources 690.IP • 691set up the authentication system, specifically the authentication server or `signer' 692.IP • 693start network services (two distinct sets: one for the authentication services and the other for 694all other network services) 695.NH 696Network database files 697.LP 698In both hosted and native modes, Inferno uses a collection of text files 699of a particular form to store all details of network and service configuration. 700When running hosted, Inferno typically gets most of its data from the host operating system, 701and the database contains mainly Inferno-specific data. 702.LP 703The file 704.CW /lib/ndb/local 705is the root of the collection of network database files. 706The format is defined by 707.I ndb (6), 708but essentially it is a collection of groups of attribute/value pairs of the form 709\fIattribute\fP\f(CW=\fP\fIvalue\fP. 710Attribute names and most values are case-sensitive. 711.LP 712Related attribute/value pairs are grouped into database `entries'. 713An entry can span one or more 714lines: the first line starts with a non-blank character, 715and any subsequent lines in that entry start 716with white space (blank or tab). 717.NH 2 718Site parameters 719.LP 720The version of 721.CW /lib/ndb/local 722at time of writing looks like this: 723.P1 724database= 725 file=/lib/ndb/local 726 file=/lib/ndb/dns 727 file=/lib/ndb/inferno 728 file=/lib/ndb/common 729 730infernosite= 731 #dnsdomain=your.domain.com 732 #dns=1.2.3.4 # resolver 733 SIGNER=your_Inferno_signer_here 734 FILESERVER=your_Inferno_fileserver_here 735 smtp=your_smtpserver_here 736 pop3=your_pop3server_here 737 registry=your_registry_server 738.P2 739The individual files forming the data base are listed in order in the 740.CW database 741entry. 742They can be ignored for the moment. 743The entry labelled 744.CW infernosite= 745defines a mapping from symbolic host names of the form 746.CW $\fIservice\f(CW 747to a host name, domain name, or a numeric Internet address. 748For instance, an application that needs an authentication service 749will refer to 750.CW $SIGNER 751and an Inferno naming service will translate that at run-time to the appropriate network name for 752that environment. 753Consequently, 754the entries above need to be customised for a given site. 755(The items that are commented out are not needed when the host's own DNS resolver is used instead 756of Inferno's own 757.I dns (8).) 758For example, our 759.CW infernosite 760entry in the 761.CW local 762file might look something like this 763.P1 764infernosite= 765 dnsdomain=vitanuova.com 766 dns=200.1.1.11 # resolver 767 SIGNER=doppio 768 FILESERVER=doppio 769 smtp=doppio 770 pop3=doppio 771 registry=doppio 772.P2 773where 774.CW doppio 775is the host name of a machine that is offering the given services to Inferno, 776and 777.CW 200.1.1.11 778is the Internet address of a local DNS resolver. 779.Ss "Enter defaults for your site" 780.LP 781The only important names initially are: 782.IP \f(CWSIGNER\fP 20 783the host or domain name, or address of the machine that will act as signer 784.IP \f(CWregistry\fP 785the name or address of a machine that provides the local dynamic service 786.I registry (4) 787.IP \f(CWFILESERVER\fP 788the primary file server (actually needed only by clients with no storage of their own) 789.LP 790All others are used by specific applications such as 791.I acme (1) 792mail or 793.I ftpfs (4). 794.LP 795If you are using a single machine for signer and server/client, put its name in those three entries. 796.NH 2 797Connection server 798.I cs (8) 799and name translation 800.LP 801The connection server 802.I cs (8) 803uses the network database 804and other 805data (such as that provided by the host system and 806the Internet DNS servers) to translate symbolic network names and services into instructions 807for connecting to a given service. 808In hosted mode, 809network and service names are passed through to the host for conversion to numeric IP 810addresses and port numbers. If the host is unable to convert a service name 811the connection server will attempt to convert the name using mappings 812of service and protocol names to Internet port numbers 813in the file 814.CW /lib/ndb/inferno : 815.P1 816tcp=infgamelogin port=6660 # inferno games login service 817tcp=styx port=6666 # main file service 818tcp=mpeg port=6667 # mpeg stream 819tcp=rstyx port=6668 # remote invocation 820tcp=infdb port=6669 # database server 821tcp=infweb port=6670 # inferno web server 822tcp=infsigner port=6671 # inferno signing services 823tcp=infcsigner port=6672 # inferno countersigner 824tcp=inflogin port=6673 # inferno credential service 825tcp=infsds port=6674 # software download 826tcp=registry port=6675 # registry(4) 827udp=virgil port=2202 # naming service 828.P2 829For the moment, leave that file as it is. 830You will only need to modify this file if in future 831you add new statically-configured services to Inferno. 832(Services that come and go dynamically might use 833.I registry (4) 834instead, a registry manager that allows a service to be found 835using a description of it.) 836.NH 837Configuring a Signer 838.LP 839Before an Inferno machine can authenticate establish a secure connection to an Inferno 840service on another machine, each system needs to obtain a certificate from a common signer.† 841We talk here as though there is only one `signer' per site but in fact there can be application- or 842group-specific ones. 843For instance, a version of the Inferno games server automatically starts its own signing service to 844keep the identities and keys used for game service separate from those of the primary 845system, allowing users to set up their own gaming groups without fuss. 846.FS 847.FA 848†The authentication system will shortly expand to a rôle-based one allowing a chain of certificates to be used, 849from several signers, with delegation etc. 850.FE 851To use authenticated connections for the primary 852file services we need to set up a signer to generate 853certificates for users (see 854.I createsignerkey (8) 855and 856.I logind (8)). 857.LP 858Choose an Inferno machine to become the signer. 859If this is the first or only 860Inferno machine on your network then make this machine the signer. 861(It is more realistic if you start up a separate copy of 862.I emu 863and leave it in `console' mode without starting the window system.) 864You can always move the function elsewhere later. 865.Ss "Empty the secret file of secrets." 866The authentication server verifies a user's identity by checking that the user knows a shared secret. 867(In fact the secret is not used directly, but instead a scrambled value that was derived from it.) 868The file 869.CW /keydb/keys 870holds those secrets; it is encrypted using a secret password or phrase known only to the 871manager of the authentication server. 872Having just installed Inferno, the file 873should exist and be readable only by you (or the user as which the authentication service will run). 874On the signer machine, type 875.P1 876ls -l /keydb/keys 877.P2 878You should see something like: 879.P1 880--rw------- M 7772 yourname inf 0 Jun 12 03:08 /keydb/keys 881.P2 882You should see something like the above. 883If the file does not exist or is not empty or has the wrong mode, use: 884.P1 885cp /dev/null /keydb/keys; chmod 600 /keydb/keys 886.P2 887to set it right. 888.Ss "Generate a signer key." 889Next on the signer machine, run 890.P1 891auth/createsignerkey \fIname\fP 892.P2 893In place of 894.I name 895enter the network name of the signer. A fully-qualified domain name of a 896host or individual is fine. 897This value will appear as the signer name in each 898certificate generated by the signer. 899.I Createsignerkey 900creates public and private keys that are used by the signer when generating 901certificates. 902They are stored in 903.CW /keydb/signerkey ; 904check that it has permissions that limit access to the user that will run the 905authentication services: 906.P1 907; ls -l /keydb/signerkey 908--rw------- M 32685 secrets inf 1010 Jul 07 2000 /keydb/signerkey 909.P2 910Use 911.I chmod (1) 912to set the mode to read/write only for the owner if necessary: 913.P1 914chmod 600 /keydb/signerkey 915.P2 916.Ss "Start the authentication network services" 917Still at the signer console, type 918.P1 919svc/auth 920.P2 921That script (see 922.I svc (8)) 923will check that the 924.CW /keydb/keys 925and 926.CW /keydb/signerkey 927files exist, and then 928start the program 929.I keyfs (4), 930which manages the 931.CW keys 932file. 933It will prompt for the password (pass phrase) you wish to use to protect the 934.CW keys 935file, now and on subsequent runs: 936.P1 937; svc/auth 938Key: 939Confirm key: 940.P2 941It prompts twice to confirm it. 942If successfully confirmed, it will then 943start the 944network services used by Inferno to authenticate local and remote users and hosts. 945(If confirmation fails, retry by running 946.CW svc/auth 947again.) 948.LP 949You can check that they are running by typing: 950.P1 951ps 952.P2 953which should show something like the following: 954.P1 955 1 1 john release 74K Sh[$Sys] 956 3 2 john alt 15K Cs 957 10 9 john recv 25K Keyfs 958 11 9 john release 44K Styx[$Sys] 959 12 9 john recv 25K Keyfs 960 14 1 john alt 8K Listen 961 16 1 john release 8K Listen[$Sys] 962 18 1 john alt 9K Listen 963 20 1 john release 9K Listen[$Sys] 964 22 1 john alt 9K Listen 965 24 1 john release 9K Listen[$Sys] 966 26 1 john alt 8K Listen 967 28 1 john release 8K Listen[$Sys] 968 29 1 john ready 73K Ps[$Sys] 969.P2 970There should be 971.CW Keyfs 972and 973.CW Listen 974processes. 975.Ss "Enter user names and secrets." 976For each user to be authenticated by the signer run 977.P1 978auth/changelogin \fIusername\fP 979.P2 980You will be prompted to supply a secret (ie, password or pass phrase) and expiration date. 981The expiration date will be used 982as the maximum expiration date of authentication certificates granted to that user. 983.I Changelogin 984(see 985.I changelogin (8)) 986accesses the name space generated by 987.I keyfs (4), 988which has just been started above by 989.CW svc/auth . 990A user can later change the stored secret using the 991.I passwd (1) 992command. 993For the signer to generate a certificate there must be at least one entry in the 994password file. 995If you are not sure at this stage of the names of the users that you want to 996authenticate then create an entry for the user 997.CW inferno 998and yourself. 999.NH 1000Establishing a Secure Connection 1001.LP 1002To establish a secure connection between two Inferno machines, each needs to present a public key with 1003a certificate signed by a common signer. 1004We shall make two public/private key sets, one for the server and one for a client 1005(they differ only in where they are stored). 1006We shall do the server first, because the usual network services require 1007the server possess some keys before they can start. 1008We shall then start those services, and finally sort out the client. 1009.Ss "Start the connection service." 1010The server still needs to make contact with the signer, so we need to start the basic connection service 1011.I cs (8). 1012If you are using the same instance of 1013.I emu 1014in which you invoked 1015.CW svc/auth 1016above, you should skip this step. 1017To check, you should see a new file in the 1018.CW /net 1019directory called 1020.CW cs . 1021Run the command 1022.P1 1023ls /net 1024.P2 1025You should see at least the following names in the output: 1026.P1 1027/net/cs 1028/net/ndb 1029/net/tcp 1030/net/udp 1031.P2 1032Otherwise, type 1033.P1 1034ndb/cs 1035.P2 1036That starts 1037.I cs (8). 1038Try the 1039.CW "ls /net" 1040again to check that the 1041.CW cs 1042file has appeared. 1043.LP 1044.Ss "Generate a server key set." 1045On the server machine (or in the `server' window), 1046use 1047.I getauthinfo (8) 1048to obtain a certificate and save it in a file named 1049.CW default 1050by running 1051.P1 1052getauthinfo default 1053.P2 1054.I Getauthinfo 1055will prompt for the address of your signer (you can often 1056just use its host name or even 1057.CW localhost ) 1058and for a remote username and password 1059combination. 1060.I Getauthinfo 1061will connect to the 1062.I inflogin 1063service on the signer and authenticate you against its user and password database, 1064.CW /keydb/keys , 1065using the username and password that you entered above. 1066Answer 1067.CW yes 1068to the question that asks if you want to save the certificate in a file. 1069.I Getauthinfo 1070will save a certificate in the file 1071.CW /usr/\fIuser\f(CW/keyring/default 1072where 1073.I user 1074is the name in 1075.CW /dev/user . 1076.NH 1077Network Services 1078.LP 1079As mentioned above, in a full Inferno network 1080the authentication services will usually be run on a secured machine of their own (the signer), 1081and the ordinary network services such as file service are not run on a signer. 1082If you are, however, using one machine for all functions, you can get the right 1083effect by starting another instance of 1084.I emu , 1085to act as an Inferno host that is not a signer. 1086This one will run the services of a primary file server 1087and the site 1088.I registry (4). 1089.LP 1090Commands described in 1091.I svc (8) 1092start listeners for various local network services. 1093(The commands are actually shell scripts.) 1094As we saw above, 1095.CW svc/auth 1096starts the services on a signer. 1097.LP 1098Here we shall start the usual set of services. 1099.KS 1100.Ss "Start the network listener services." 1101Type 1102.P1 1103svc/net 1104.P2 1105.KE 1106Various network services will (should!) now be running. To confirm this type 1107.P1 1108ps 1109.P2 1110which should show something like the following: 1111.P1 1112; ps 1113 1 1 inferno release 74K Sh[$Sys] 1114 7 6 inferno alt 15K Cs 1115 13 1 inferno recv 15K Registry 1116 14 1 inferno release 44K Styx[$Sys] 1117 15 1 inferno recv 15K Registry 1118 17 1 inferno alt 8K Listen 1119 19 1 inferno release 8K Listen[$Sys] 1120 22 1 inferno alt 8K Listen 1121 24 1 inferno release 8K Listen[$Sys] 1122 25 1 inferno ready 74K Ps[$Sys] 1123.P2 1124There should be a few 1125.CW Listen 1126processes and perhaps a 1127.CW Registry . 1128.LP 1129You can also try 1130.P1 1131netstat 1132.P2 1133.I Netstat 1134prints information about network connections. You should see 1135several lines of output, each one describing an announced TCP or UDP service. 1136Depending upon the contents of the network configuration files we included on the CD, 1137you might see output something like this: 1138.P1 1139tcp/1 Announced inferno 200.1.1.89!6668 ::!0 1140tcp/2 Announced inferno 200.1.1.89!6666 ::!0 1141tcp/3 Announced inferno 200.1.1.89!6675 ::!0 1142.P2 1143Each line corresponds to a network connection: 1144the connection name, the name of the user running the server, 1145the address of the local end of the connection, 1146the address of the remote end of the connection, 1147and the connection status. 1148The connection name is actually the protocol and conversation directory 1149in 1150.CW /net . 1151The connection addresses are all of the form \fIhost\f(CW!\fIport\fR 1152for these IP based services, and the remote addresses are not filled in 1153because they all represent listening services that are in the 1154.CW Announced 1155state. 1156In this example the third line shows a TCP service listening on port 6675. 1157Examining 1158.CW /lib/ndb/inferno 1159with 1160.CW grep 1161(see 1162.I grep (1)) 1163shows that the listener on port 6675 is the Inferno registry service 1164.P1 1165grep 6675 /lib/ndb/inferno 1166.P2 1167gives 1168.P1 1169tcp=registry port=6675 # default registry 1170.P2 1171.LP 1172Now the server is ready but we need a client. 1173.LP 1174Either use a third machine or (more likely at first) simply start another 1175.I emu 1176instance in a new window. 1177Start its connection server, again by typing 1178.P1 1179ndb/cs 1180.P2 1181The connection server is fundamental to the Inferno network. 1182Once networking is set up, when subsequently starting up 1183a client you should start 1184.I cs 1185before starting the window system. 1186Note that if you are running the Inferno instance as a server, or combined 1187server and client, 1188the 1189.CW svc/net 1190that starts the network services 1191automatically starts 1192.I cs , 1193and you need not do so explicitly. 1194.LP 1195.Ss "Generate a client certificate." 1196Obtain a certificate for the client in the same way as on the server. 1197We shall obtain a certificate for use with a specific server 1198by storing 1199it in a file whose name exactly matches the network address of the server 1200.P1 1201getauthinfo tcp!\fIhostname\fP 1202.P2 1203Use the current machine's 1204.I hostname . 1205.I Getauthinfo 1206stores the certificate in the file 1207.CW /usr/\fIuser\fP/keyring/\fIkeyname\fP 1208where 1209.I user 1210is the name in 1211.CW /dev/user 1212and 1213.I keyname 1214is the argument given to 1215.I getauthinfo . 1216Again, 1217answer 1218.CW yes 1219to the question that asks if you want to save the certificate in a file. 1220.LP 1221Now that both client and server have a certificate obtained from the same signer 1222it is possible to establish a secure connection between them. 1223Note that getting keys and certificates with 1224.I getauthinfo 1225is normally done just once (or at most once per server when the 1226.CW default 1227key is not used). 1228In short, all the work done up to now need not be repeated. 1229After this, provided the keys were saved to a keyring file, 1230as many authenticated connections can be made as desired 1231until the certificate expires (which by default is whenever the password entry 1232was set to expire). 1233Also note that the certificates for different machines can have 1234different signers, and one can even use different certificates for the same machine 1235when the remote user name is to differ 1236(the 1237.CW -f 1238option of 1239.I getauthinfo 1240can then be useful to force an appropriate keyring name). 1241.Ss "Make an authenticated connection." 1242The script 1243.CW svc/net 1244on the server started fundamental name services and also a Styx file service. 1245That can also be started separately using 1246.CW svc/styx . 1247In either case the namespace that is served 1248is the one in which the command was invoked. 1249Now you can test the service. 1250.LP 1251Confirm that 1252.CW /n/remote 1253is an empty directory by typing 1254.P1 1255lc /n/remote 1256.P2 1257You can now mount the server's name space 1258onto the client's directory 1259.CW /n/remote 1260by typing 1261.P1 1262mount \fIserveraddr\fP /n/remote 1263.P2 1264Where 1265.I serveraddr 1266is the IP address of the server or a name that the host can resolve to the 1267IP address of the server. 1268Now 1269.P1 1270lc /n/remote 1271.P2 1272should reveal the files and directories in the namespace being served by the server. 1273Those files are now also visible in the namespace of your shell. 1274You will notice that these changes only affect the shell in which you ran the 1275.I mount 1276command \- other windows are unaffected. 1277You can create, remove or modify files and directories in and under 1278.CW /n/remote 1279much as you can any other file or directory in your namespace. 1280In fact, in general, a process does not need to know whether a file 1281actually resides locally or remotely. 1282You can unmount the mounted directory with 1283.I unmount . 1284Type 1285.P1 1286unmount /n/remote 1287.P2 1288You can confirm that it has gone by running 1289.P1 1290ls /n/remote 1291.P2 1292All connections made by Inferno are authenticated. The default connection 1293made by 1294.I mount 1295is authenticated but uses neither encryption nor secure digests. 1296You can pass an argument to 1297.I mount 1298to specify 1299a more secure connection: 1300its 1301.CW -C 1302option gives it a hashing and an encryption algorithm to be applied to 1303the connection. 1304.KS 1305.Ss "Make a secure authenticated connection." 1306For example, 1307.P1 1308mount -C sha1/rc4_256 \fIserveraddr\fP /n/remote 1309.P2 1310makes an authenticated connection to the machine given by 1311.I serveraddr , 1312then engages SHA1 hashing for message digesting and 256-bit RC4 for encryption. 1313.KE 1314It mounts the namespace served by 1315.I serveraddr 's 1316Styx service on the local Inferno directory 1317.CW /n/remote . 1318.NH 1319Adding new users 1320.LP 1321Every inferno process has an associated 1322.I "user name" . 1323At boot time the user name is set equal to your login name on the host 1324operating system. 1325The user name is used by 1326.I wm/logon 1327to select the home directory, and 1328by other programs like 1329.I mount 1330when it searches for certificates. 1331(It can also control permission for file access on the local system in native Inferno 1332and some hosted Inferno configurations.) 1333When you attach to a server on another 1334system the user name in the authenticating certificate can be used by 1335the remote file service to set the user name appropriately there.† 1336.FS 1337.FA 1338†The details are system-dependent and currently subject to change. 1339.FE 1340.LP 1341To create a new user, copy the directory 1342.CW /usr/inferno 1343into 1344\f(CW/usr/\fP\fIusername\fP. 1345If the user is to have access to services on the network, 1346make an authentication server entry using 1347.I changelogin (8). 1348The user can change the stored secret using 1349.I passwd (1), 1350if desired. 1351Having logged in for the first time, the user should generate 1352a default public/private key set using 1353.I getauthinfo (8). 1354(The authentication services must be running somewhere.) 1355.LP 1356The 1357.I wm 1358window manager program 1359.I wm/logon 1360allows a user to login to the local Inferno system as an Inferno 1361user (different from the host user name). 1362Its use is shown next. 1363.Ss "Re-start Inferno." 1364You should now close down any instances of 1365.I emu 1366that you are currently running. 1367The quickest way to do this is to 1368type 1369.I control-c 1370in the emu window in which you ran 1371.I wm/wm . 1372Start a new 1373.I emu , 1374as before, by either running 1375.P1 1376emu 1377.P2 1378or by choosing the appropriate entry from your start menu on 1379Windows machines. This time, start network services 1380.P1 1381svc/net 1382.P2 1383and then run 1384.P1 1385wm/wm wm/logon 1386.P2 1387and log in as user 1388.I inferno . 1389When you log in, 1390.I wm/logon 1391will change directory to 1392.CW /usr/inferno 1393and then write the name 1394.CW inferno 1395to 1396.CW /dev/user . 1397If the file 1398.CW /usr/inferno/namespace 1399exists it will be used to construct a new namespace for the user 1400based on the commands that it contains (see 1401.I newns (2)). 1402.NH 1403What next 1404.LP 1405You should now have a fully functional Inferno system. 1406You will need to have a three button mouse to use 1407.I acme , 1408.I wm , 1409or 1410.I plumbing . 1411.LP 1412To learn more you could start with the manual pages for: 1413.I intro (1), 1414.I emu (1), 1415.I wm (1), 1416.I wm-misc (1), 1417.I sh (1), 1418.I acme (1), 1419and 1420.I limbo (1) 1421and also the papers in sections 1, 2 and 3 1422of Volume 2 of 1423.I "The Inferno Programmer's Manual" . 1424