IBM Support

IBM AIX and PowerVM (VIOS) Reference: Resolving the system login message "Server refused to allocate pty"

Troubleshooting


Problem

While logging in to a system, a user may be presented with the message "Server refused to allocate pty"  and the user will not be able to log in.

Cause

When a user logs in to a system using a terminal, their login session is assigned a pseudo terminal (referred to as a pty).  When the system wide (maximum) number of pty sessions has been reached, users attempting to log in using a terminal will be presented the message Server refused to allocate pty This message will not occur when using attempt to log in using data transferred tools such as FTP.

Resolving The Problem

To prevent the message and allow more users to log in to the system, following these step by step instructions:
If possible, Reboot the server first before going through the following commands as might help to clear some of those idle opened terminals:
Option1:
If the system is not configured at the maximum number of pty sessions, use one of the following methods to change the number of pty sessions, Reboot won't be required at this point. If the system is already configured at the maximum number of pty sessions, follow the instructions for Option #2.

Method # 1.  Using smitty

# smitty pty 
> Change / Show Characteristics of the pty
> Increase "Maximum number of Pseudo-Terminals"
-increase this to 512 - 102


Method #2. Using command
 
To view current number of pty sessions:

To view current number of pty sessions:
# lsattr -El pty0 | grep ATTnum

To increase the number of pty sessions:
# chdev -l pty0 -a ATTnum=512
Option 2:
Method:   Reboot the system

Rebooting the system will force all users off.
Option 3:
Use the TMOUT and timeout shell variable to automatically close inactive sessions

When the TMOUT is set, it will automatically log out sessions that have been inactive for the specific number of sections.
Using this variable can help to better manage inactive sessions and reduce the # of actively used pty.
As with making any system wide global change, caution should be taken when setting this variable in a system-wide profile
Such as /etc/environment or /etc/profile.For information about using these shell variables, refer to the AIX documentation:
https://www.ibm.com/docs/en/aix/7.2?topic=control-enabling-automatic-logoff.

Document Location

Worldwide

 
SUPPORT

If you require more assistance, use the following step-by-step instructions to contact IBM to open a case for software with an active and valid support contract.  

1. Document (or collect screen captures of) all symptoms, errors, and messages related to your issue.

2. Capture any logs or data relevant to the situation.

3. Contact IBM to open a case:

   -For electronic support, see the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, see the web page:
      https://www.ibm.com/planetwide/

4. Provide a clear, concise description of the issue.

 - For guidance, see: Working with IBM AIX Support: Describing the problem.

5. If the system is accessible, collect a system snap, and upload all of the details and data for your case.

 - For guidance, see: Working with IBM AIX Support: Collecting snap data

Click here to submit feedback for this document.
Kareem A. Mostafa

[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z000000cw0AAAQ","label":"Networking->TCPIP"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
28 June 2021

UID

ibm16466433