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
Method #2. Using command
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.
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.
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
[{"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"}]
Was this topic helpful?
Document Information
Modified date:
28 June 2021
UID
ibm16466433