PTY allocation request failed on channel 0

Recently I tried to ssh into a guest in vmware. I was able to authenticate in the server and I was not able to access the console. I was getting the following error.

$ ssh x.x.x.x
The authenticity of host ‘x.x.x.x (x.x.x.x)’ can’t be established.
RSA key fingerprint is 1c:4d:1b:6g:d5:40:db:5b:46:7f:bb:17:b1:1b:41:80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘x.x.x.x’ (RSA) to the list of known hosts.
root@x.x.x.x’s password:
PTY allocation request failed on channel 0

On checking the logs from the console, I found the following error.

sshd[2641]: pam_unix(sshd:session): session opened for user root by (uid=0)
sshd[2641]: error: openpty: No such file or directory
sshd[2641]: error: session_pty_req: session 0 alloc failed
sshd[2756]: pam_unix(sshd:session): session opened for user root by (uid=0)
sshd[2756]: error: openpty: No such file or directory
sshd[2756]: error: session_pty_req: session 0 alloc failed

I found that the device file ptmx was missing the server. Now I have to recreate the device file. I googled around for sometime and found the following solution.

$ sbin/MAKEDEV -d /dev ptmx

And it worked. I restarted SSH service and was able to login to the vmware guest. 🙂

Install APC in cPanel server

You can install APC (Alternative PHP Cache) in your cpanel server using the following steps:

# pecl install apc

Then add the extension in the php.ini file.

You can get the php.ini file by

# php –ini

Add the following line to it.

extension=”apc.so”

Then, retart apache service and you are good to go.

I encountered the following error while installation.

“checking whether the C compiler works… configure: error: cannot run C compiled programs.”

I made it working by the following:

# mount -o remount,exec,suid /tmp

Complete the installation and don’t forget to remount the tmp directory with noexec, nosuid options after the installation.

Install Zimlets in Zimbra (ZCS)

Zimlets are delivered as a zip file that includes all the files necessary to run the Zimlet. The zip file should be copied to the Zimbra servers to deploy the Zimlet to users.

Deployment and management of Zimlets is only from the command line (CLI).

To deploy a Zimlet to the default COS

Copy the zip file to the /opt/zimbra/zimlets directory.

Type the following commands as zimbra user:

zmzimletctl install zimlet_name.zip
zmzimletctl deploy zimlet_name.zip
zmzimletctl enable zimlet_name

zmzimletctl info zimlet_name  will give you the information about the zimlet you have installed.
zmzimletctl listZimlets will list all the zimlets installed in the system.

To uninstall zimlets, you can use the following commands.

zmzimletctl disable zimlet
zmzimletctl undeploy zimlet

This will uninstall the zimlets from the zimbra.

Ref: Zimlets

Subversion install error

You may get the following error while installing subversion:

root@server [/usr/src]# yum install subversion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.nluug.nl
* extras: ftp.nluug.nl
* updates: ftp.nluug.nl
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package subversion.i386 0:1.6.11-7.el5_6.3 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Processing Dependency: neon >= 0.25.5-6.el5 for package: subversion
–> Processing Dependency: libneon.so.25 for package: subversion
–> Processing Dependency: libapr-1.so.0 for package: subversion
–> Processing Dependency: libaprutil-1.so.0 for package: subversion
—> Package subversion.x86_64 0:1.6.11-7.el5_6.3 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Processing Dependency: libaprutil-1.so.0()(64bit) for package: subversion
–> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion
–> Running transaction check
—> Package apr.i386 0:1.2.7-11.el5_5.3 set to be updated
—> Package apr.x86_64 0:1.2.7-11.el5_5.3 set to be updated
—> Package apr-util.i386 0:1.2.7-11.el5_5.2 set to be updated
–> Processing Dependency: libpq.so.4 for package: apr-util
—> Package apr-util.x86_64 0:1.2.7-11.el5_5.2 set to be updated
–> Processing Dependency: libpq.so.4()(64bit) for package: apr-util
—> Package neon.i386 0:0.25.5-10.el5_4.1 set to be updated
—> Package neon.x86_64 0:0.25.5-10.el5_4.1 set to be updated
—> Package subversion.i386 0:1.6.11-7.el5_6.3 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
—> Package subversion.x86_64 0:1.6.11-7.el5_6.3 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Running transaction check
—> Package postgresql-libs.i386 0:8.1.23-1.el5_6.1 set to be updated
—> Package postgresql-libs.x86_64 0:8.1.23-1.el5_6.1 set to be updated
—> Package subversion.i386 0:1.6.11-7.el5_6.3 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
—> Package subversion.x86_64 0:1.6.11-7.el5_6.3 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Finished Dependency Resolution
subversion-1.6.11-7.el5_6.3.x86_64 from updates has depsolving problems
–> Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.x86_64 (updates)
subversion-1.6.11-7.el5_6.3.i386 from updates has depsolving problems
–> Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.i386 (updates)
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.i386 (updates)
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.x86_64 (updates)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

The fix was to temporarily remove perl from the /etc/yum.conf exclude line and install subversion.

Add perl back to the /etc/yum.conf exclude line after subversion installation is completed in the system.

Ref: http://forums.cpanel.net/f42/please-help-me-install-these-encoders-204682.html

cPanel upcp error : Undefined subroutine

I have seen recent cPanel upgrade throwing errors shown below:

root@server [~]# /scripts/upcp
/scripts/upcp syntax OK
Running Futex Check/Fix……Done
Undefined subroutine &Cpanel::Update::automatic_updates_enabled called at /scripts/upcp line 273.

This can be fixed using below steps.

wget -O /root/updatenow.static http://httpupdate.cpanel.net/cpanels…datenow.static && perl /root/updatenow.static –manual

Now you will be able to upgrade the cPanel using upcp script.

/scripts/upcp –force

It worked for me.

Zimbra PreAuth Keys

Preauth stands for pre-authentication, and is a mechanism to enable a trusted third party to vouch for a user’s identity. For example, if a user has already signed into a portal and wants to enter the mail application, they should not have to be prompted again for their password.

You can create preauth key by the following command.

zmprov gdpak domain.com

It is stored in a zimbra attribute. You can get it by the command,

zmprov getDomain testdomain.com zimbraPreAuthKey

If this returns null, then preauth key is not generated earlier. Else, it will return the preauth key of the domain.

More details can be read from http://wiki.zimbra.com/wiki/Preauth

Change MySQL database collation

You can change database collation from the WHM/cPanel.

1. Enter your WHM/cPanel and select phpMyAdmin.

2. Select the database you wish to manage.

3. Click on the Operations tab in the top menu of your phpMyAdmin

4.  At the bottom of the page you will see the collation option. Select a collation from the drop down menu and click on the Go button.

You are all set.

Reset Zimbra Admin Password

Sometimes you may need to reset the password of the admin account in Zimbra from CLI.

To get the list of all administrators in Zimbra, you can use:

su – zimbra

zmprov gaaa

To reset the password of the admin account, use:

zmprov sp <admin@domain.com> <your desired password>

Hope this will help you all.

Download RPM packages using YUM

You can download packages via yum without installing/updating them. For this, you have to install a plugin named yum-downloadonly.Install the package using yum itself.

# yum install -y yum-downmloadonly

To download the packages, use the following commands:

# yum install package -y –downloadonly

The package will be downloaded and saved to the /var/cache/yum/ directory in this case.

To download it to the /usr/src/ directory, use the following:

# yum install package -y –downloadonly –downloaddir=/usr/src/

Now you can install the package using,

# rpm -ivh packagename.rpm