Server refused to allocate pty Warning: no access to tty (Bad file number)

(Also for Solaris PTY. Setting up number of PTYs)

That error was experienced when trying to connect to a server through ssh. The server being accessed here is a Sunfire V20 running Solaris 2.6.

First glance, looks like that the maximum number of allowed ssh connection has been reached. This is a knows issue for old version of Solaris but not in 5.8 and newer. Solaris kernel tuning is required.

All jobs/services were transferred from one box to another. From the old server, there was no reported login problem (“Server refused to allocation pty”) ever.

Setup maxuser on Solaris 2.6

To change the default value of ‘maxuser’ on a Solaris 2.6, we need to edit /etc/system and add the required value.

The default value is set to either the number of MB of physical memory or MAX_DEFAULT_MAXUSERS, whichever is lower.

For Solaris 2.5.1-7, MAX_DEFAULT_MAXUSERS is 1024. For Solaris 8-10, MAX_DEFAULT_MAXUSERS is 2048.

maxusers can be set explicitly in the /etc/system file, but is limited to 2x MAX_DEFAULT_MAXUSERS.

After editing the /etc/system file, the box need to be restarted.

More information can be seen here and here.

One thought on “Server refused to allocate pty Warning: no access to tty (Bad file number)”

  1. Hi,
    I am experiencing the same problem of “server refused to allocate pty” no access to tty: as follows. It is in solaris 9 and the server is E2900. The error message is attached. I could not even get a prompt to work on even in the console or serial port. Please do reply me if anybody has some suggestions.

    Warning: no access to tty (Bad file number).
    Thus no job control in this shell.
    Sun Microsystems Inc. SunOS 5.9 Generic May 2002
    You have new mail.

Leave a Reply

Your email address will not be published. Required fields are marked *