The frustration of finding on a Unix-like operating system : “the pts/27 is now locked by liu.yang. password: authentication failure”. This is made worse when you particularly want a terminal session. Most probably, the pseudo-terminal is locked as pts/27 and an authentication attempt with password has failed. In order to avoid terminal lock issues, its causes, and guidelines to rectify the problem, even the system administrator needs to know this. This article explains the probable reasons behind, various troubleshooting methods available, and best practices for handling any authentication problem
Key Giveaways
- Understanding why terminal session locks happen and how they can impact system usage.
- Detailed troubleshooting steps to resolve locked terminal sessions.
- Security considerations and best practices for preventing authentication issues.
- Frequently asked questions related to terminal session locks and authentication failures.
“What does the message ‘pts/27 is Now Locked by liu.yang. Password: Authentication Failure’ indicate?
The message talks about a problem encountered with a Unix/Linux environment. An issue is the pseudo-terminal (PTS) pts/27, which is locked by an account called “liu.yang.” As explained above, locking the terminal means that an active or hung session is preventing other users and processes from gaining access to the terminal. Additionally, the password authentication failure made the system fail to authenticate the credentials of the user probably because access cannot proceed further.
Also, Read More: the pts/27 is now locked by liu.yang. password: authentication failure.
Causes of Terminal Lock and Authentication Failures
There are several causes as to how a terminal lock and authentication failure may occur:
User Session Still Active: An active session could prevent access on the named PTS, potentially causing a lock. the pts/27 is now locked by liu.yang. password: authentication failure.
- Hung or Abandoned Session: If a user simply drops off or the session hangs, the terminal could be locked.
- Failed Logon with Incorrect Password Attempt: If a user attempts multiple failed logons, the system may cause a block on access.
- System Resource Limitations: In case the system lacks one or all the necessary resources, then there may be lock problems on the terminal.
- Configuration Problems: At other times, the problem is due to incorrect configurations or permission-related problems with the system.
Troubleshooting the Locked Terminal Problem
Follow these steps to troubleshoot and solve a locked terminal session problem:
Check the Active Sessions
Check if there is an active session that matches “liu.yang” on pts/27 by using the following command
This command lists active user sessions and points you to the terminal in question. If pts/27 is still in use, tell the user to log off properly.
Killing the session with ‘Kill’
If you can’t get in touch with the user or the session has been hung, you can kill it with this.
Substitute for the actual process ID assigned to the locked session, which you can find using:
Check System Logs for Authentication Errors
Search through system logs for possible relevant error messages that may involve authentication. The following command will show the contents of system logs:
Look for error patterns that include frequent authentication failure or misconfiguration.
Correct Permissions and Configuration Settings
For SSH configuration, refer to the settings within configuration files like /etc/ssh/sshd_config or check limits of user sessions within the /etc/security/limits.conf .
Unlocks PTS locks using ‘fuser’
Fuser command will terminate any process locking the PTS. Run this command:
This should terminate any process using the locked terminal.
Check for Resource Limitations
If the system resources, such as memory or CPU, are low, allocate additional resources or close unnecessary applications to free up more system capacity.
Update and Restart Authentication Services
One would update or restart services like sshd, hence correcting problems resulting from authentication issues:
Preventing Terminal Lock and Login Authentication Complications
Prevent terminal locking and authentication issues from arising again in the future by adopting the following best practices:
- Limit Failed Login Attempts. Therefore, install security tools such as fail2ban that limit failed login attempts
- Upgrade System and Authentication Services Regularly: Upgrade your system to discourage the wide range of vulnerabilities and bugs in it.
- Activate MFA: It provides an additional layer that makes it difficult for an unauthorised person to gain access.
Understanding PTS and Terminal Locking Mechanisms
PTS is basically a virtual terminal interface, which is also referred to as pseudo-terminal slave. Each of the PTS sessions can be considered to be as a terminal or an end connected over a remote terminal or local terminal. the pts/27 is now locked by liu.yang. password: authentication failure.
Some common PTS-Related Commands
Command | Description |
---|---|
who | List all logged-in users and their PTS terminals. |
`ps aux | grep pts/x` |
fuser -k /dev/pts/x | Kill the process using the specified PTS terminal. |
sudo systemctl restart sshd | Restart SSH services to refresh authentication settings. |
Why Does Authentication Fail?
Authentication failure typically has the cause in improper login credentials, perhaps network configuration, or excessivelhe validity of the passwords has could not be result in failed logins.
- Locked Accounts: User accounts may be locked as a security measure on failed login attempts.
Security Implication – Terminal Lock Issues
Terminal locks are insecure without control. However, relentless terminal locks leave the system wide open to threats like unauthorized access, denial of service, or brute-force attacks.
Solution of Some Frequently Asked Questions on Terminal Lock and Authentication Problem
How to Unlock a PTS Terminal?
To get the unlock for a PTS terminal, identify which session you have locked with the who command and kill the associated process by using either the kill command or the fuser command .
Why ‘Password Authentication Failure’ Enters Just After One Types in a Correct Password?
The failure is again because of the fact that accounts are locke, some passwords might have expire, and in some cases, the authentication settings. You can identify why by checking the system’s logs.
Can Avoiding Locking Issues in the PTS Terminal Be Done?
Yes, by enforcing session time-out policies, frequent system re-boots and updates, and multi-factor authentication.
What Is ‘pts/27’?
“pts/27” is pseudo-terminal, the virtualization of a terminal session in Unix/Linux environment. The number behind the designation indicates which particular terminal instance it is.
Is It Safe to Kill the Locked Terminal Process?
Yes, if you are sure the session is dead or stuck, you can safely do it if you can first lay hold of the user and let them know.
Also, Read More: the pts/27 is now locked by liu.yang. password: authentication failure.
Conclusion
The error “pts/27 is now locke by liu.yang. password: authentication failure” sometimes becomes hard to handle, but the actual causes of the error and proper debug rectify it within no time. Proper session management of the user along with the adoption of best practices in system security would enjoy a stable environment along with its authentication.