• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“Server refused to allocate pty” – Unable to login to CentOS/RHEL

by admin

The Problem

On an CentOS/RHEL 6 server, all logins started to fail to the system with the following errors:

Server refused to allocate pty
/etc/profile: line 48: /dev/null: Permission denied
  /etc/profile: line 76: /dev/n ull: Permission denied
  /etc/profile: line 76: /dev/null: Permission denied
  /etc/pr ofile: line 76: /dev/null: Permission denied
  /etc/profile: line 76: /dev/null: Permission denied
  /etc/profile: line 76: /dev/null: Permission denied
  /etc/profile: line 76: /dev/null: Permission denied
  /etc/profile: line 76: /dev/null: Permission denied

Applications and database instancea on the server also started to fail.

The Solution

This can happen if the file under directory /dev/shm are removed. When trying to free up space by finding large files to remove in /root and /tmp we might also remove files under /tmp/shm unintentionally. /dev/shm (also known as tmpfs) is a file system used for shared memory between systems or user processes. tmpfs uses virtual memory, rather than accessing disk storage, giving significant performance improvements, and is managed by the Linux kernel.

If tmpfs has files deleted manually from it, it can impact on the running system or user processes and services that can no longer access the contents of shared memory they had been using, and it can thus cause system or application failures.

tmpfs is not intended for long-term storage, and it shouldn’t need to be manually changed or altered by users. In this case, the removal of files from tmpfs caused the allocation of terminals to users trying to log into the system to fail, so it became impossible for any users to log in to the system. Some files that were also being used by databases instances were removed, which causes the databases and applications to fail.

As tmpfs uses virtual memory for file storage, the contents of tmpfs don’t persist between reboots, and the contents of tmpfs are freshly generated whenever a system is rebooted. To resolve this issue, please reboot/reset the system.

Filed Under: CentOS/RHEL, CentOS/RHEL 5, CentOS/RHEL 6

Some more articles you might also be interested in …

  1. Understanding Power Management in RedHat Virtualization (RHV)
  2. Bind to port 22 on 0.0.0.0 failed: address already in use – error while starting sshd service CentOS/RHEL
  3. Spacewalk Installation Steps On CentOS/RHEL
  4. CentOS / RHEL : How to change the UUID of the filesystem
  5. Unable to start Nagios Service (CentOS/RHEL)
  6. How to Tune Btrfs Filesystem for Better Performance
  7. lvdisplay error: “Failed to create directory /var/lock/lvm. File-based locking initilisation failed.”
  8. Understanding Linux multipath (dm-multipath)
  9. How to use ldconfig Command in Linux
  10. How to use perf tool for tracing similar to dtrace

You May Also Like

Primary Sidebar

Recent Posts

  • batch: Execute commands at a later time when the system load levels permit
  • bat: Print and concatenate files
  • bastet: Clone of the game Tetris in the terminal
  • bashmarks: Save and jump to commonly used directories using 1 character commands

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright