Annotation of wikisrc/tutorials/how_to_use_ptyfs.mdwn, revision 1.1

1.1     ! mspo        1: **Contents**
        !             2: 
        !             3: [[!toc]]
        !             4: 
        !             5: #  What is ptyfs ? 
        !             6: 
        !             7: ptyfs is a pseudo-terminal device file system written by Christos Zoulas. It first appeared in NetBSD 3.0. 
        !             8: 
        !             9: #  How does it work ? 
        !            10: 
        !            11: The traditional bsd style pty's are allocated to a fixed number of pty devices available. That is normally ttyp0 - ttyp9 and ttypa - ttypf which makes 16 ptys in total. There are also the groups of ttyq*, ttyr*, ttys* in the same way, which makes a total of 16 * 4 = 64 devices. This means, that no more than 64 remote connections to a NetBSD machine are possible. 
        !            12: 
        !            13: ptyfs on the contrary is allocating the devices dynamically. That means, whenever a remote connection is established, a new device is created. This way the number of connections are only limited by the resources of the server. 
        !            14: 
        !            15: #  Why do I need it ? 
        !            16: 
        !            17: Normally you don't. You will need ptyfs, if you're going to run a server with hundreds (> 64) of remote connections (ssh or telnet). There are also a few applications like Matlab, that require ptyfs. I personally prefer ptyfs and use it on all my servers. 
        !            18: 
        !            19: #  How do I use it ? 
        !            20: 
        !            21: If you use NetBSD 4.0 or higher, ptyfs is enabled by default in all GENERIC Kernels. Otherwise, you have to rebuild your Kernel to use PTYFS. To enable PTYFS please ensure that the line 
        !            22:     
        !            23:     file-system PTYFS 
        !            24:     
        !            25: 
        !            26: is uncommented, or available in your Kernel config file. Now, rebuild your Kernel and reboot. 
        !            27: 
        !            28: #  Setting up /dev/pts 
        !            29: 
        !            30: Change into the `/dev` directory and create the directory pts as root. 
        !            31:     
        !            32:     # cd /dev
        !            33:     # mkdir pts
        !            34:     
        !            35: 
        !            36: #  Testing ptyfs 
        !            37: 
        !            38: Before we change the file `/etc/fstab`, we have to ensure, that ptyfs is working. Otherwise your server won't be able to boot. To test if ptyfs is working, mount it manually. 
        !            39:     
        !            40:     # mount_ptyfs ptyfs /dev/pts
        !            41:     
        !            42: 
        !            43: Check, if it is mounted: 
        !            44:     
        !            45:     # mount
        !            46:     # ptyfs on /dev/pts type ptyfs (local)
        !            47:     
        !            48: 
        !            49: #  Editing fstab 
        !            50: 
        !            51: You can now edit your `/etc/fstab` to mount it automatically everytime you boot. Please add exactly this line to your `/etc/fstab`: 
        !            52:     
        !            53:     ptyfs /dev/pts ptyfs rw 0 0
        !            54:     
        !            55: 
        !            56: #  Remote connections 
        !            57: 
        !            58: New incoming remote connections are now acquired dynamically. You will notice that the new connections are called pts/* instead of ttyp* 
        !            59:     
        !            60:     # w
        !            61:     11:34PM  up  1:28, 2 users, load averages: 0.12, 0.10, 0.08
        !            62:     USER     TTY     FROM                     LOGIN@  IDLE WHAT
        !            63:     root     console -                        10:07PM     0 csh
        !            64:     john     pts/0   princeton.preston.edu    11:34PM     0 w
        !            65:     
        !            66: 
        !            67: You're done. Have fun. 
        !            68: 
        !            69: #  See also 
        !            70: 
        !            71:   * [mount_ptyfs(8)](http://netbsd.gw.com/cgi-bin/man-cgi?mount_ptyfs+8+NetBSD-current)
        !            72: 
        !            73:    [13]: http://netbsd.gw.com/cgi-bin/man-cgi?mount_ptyfs+8+NetBSD-current (http://netbsd.gw.com/cgi-bin/man-cgi?mount_ptyfs+8+NetBSD-current)
        !            74: 
        !            75: #  View source code (Please report any bugs or suggestions [here](http://www.netbsd.org/cgi-bin/sendpr.cgi?gndb=netbsd)). 
        !            76: 
        !            77:   * [mount_ptyfs.c](http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/sbin/mount_ptyfs/mount_ptyfs.c?rev=HEAD)
        !            78: 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb