Fixin’ issues one ticket at a time!
Linux
cPHulk Brute Force Detection
Jul 28th
Ever run into issues with typing in your root password, or forgot what you set it to, then got locked out of WHM? Well, here’s a quick and easy way to get your access back when receiving this error message.
This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.
Run the following as root in SSH.
mysql cphulkd mysql> delete from brutes; mysql> delete from logins;
A few OpenVZ commands
Feb 28th
Below are the commonly used OpenVZ commands, which are run from the main node.
vzlist -a
Shows list of all the VPS’s hosted on the Node.
vzctl start VEID
To start the VPS
vzctl stop VEID
To stop (Shut Down) the VPS
vzctl status VEID
To view the status of the particular VPS
vzctl stop VEID –fast
To stop the VPS quickly and forcefully
vzctl enter VEID
To enter in a particular VPS
vzctl set VEID –hostname vps.domain.com –save
To set the Hostname of a VPS
vzctl set VEID –ipadd 1.2.3.4 –save
To add a new IP to the hosting VPS
vzctl set VEID –ipdel 1.2.3.4 –save
To delete the IP from VPS
vzctl set VEID –userpasswd root:new_password –save
To reset root password of a VPS
vzctl set VEID –nameserver 1.2.3.4 –save
To add the nameserver IP’s to the VPS
vzctl exec VEID command
To run any command on a VPS from Node
vzyum VEID install package_name
To install any package/Software on a VPS from Node
**VEID refers to the ID of the Particular VPS**
Session.save_path error
Dec 1st
So…I came across this error on a clients site which he was receiving when trying to install a 3rd party script.
The session.save_path setting in your php configuration file (php.ini) is not set or is set to a folder which did not exist. You might need to set the save_path setting in php.ini or verify that the folder sets in save_path exist.
It’s a pretty simple fix in the servers php.ini. More >
Install fantastico on cPanel
Nov 29th
A fantastico installation is pretty straight forward. First thing you need to do is obtain a Fantastico license from Netenburg.
One of the most common issues when installing fantastico is a buggy wget install on the server, so a working wget version will need to be installed. Another common issue is cPanels internal php may break, but we will discuss the fix to that later on. More >
Exim Error: Ratelimit database not available
Nov 18th
2009-07-20 21:58:07 Failed to get write lock for /var/spool/exim/db/ratelimit.lockfile: timed out
2008-07-20 21:58:07 H=[xx.xx.xx.xx] temporarily rejected connection in “connect” ACL: ratelimit database not available
To fix such an error , the exim cache database on the server side needs to be clear off to stop this message. More >
Creating an extracting tar files
Nov 7th
The most common compressed archive file format in Linux is the tar.gz format. Tar file is an archive file format. Tar.gz is a compressed tar file.
How to create a compressed tar.gz file from a folder or file in Linux?
In order to create a compressed tar.gz archive from a folder/file we need to run the following tar command:
tar -czf new-tar-file-name.tar.gz file-or-folder-to-archive
Here is the command explanation:
- tar – the tar command.
- c – create new archive.
- z – compress the archive using gzip.
- f – use archive file.
- new-tar-file-name.tar.gz – the name of the tar.gz to create.
- file-or-folder-to-archive – the name of the folder we want to archive.
More >
pty, ptyp, and tty errors
Nov 2nd
So I came across this error for the first time today when trying to SSH directly into a clients VPS.
login as: root
root@server’s password:
Server refused to allocate pty
stdin: is not a tty
After a quick google search I came across the fix.
[root@node /]# vzlist -a
VEID NPROC STATUS IP_ADDR HOSTNAME
1337 78 running 69.10.59.80 grumpy.thelinuxnoob.com
[root@node /]# vzctl exec 1337 /sbin/MAKEDEV ptyp
[root@node /]# vzctl exec 1337 /sbin/MAKEDEV tty
[root@node /]# vzctl exec 1337 /sbin/MAKEDEV pty
The issue should now be resolved and you can SSH into the VPS.
Install Perl
Oct 22nd
Very simple install, only 4 commands via SSH and takes about 20 minutes for the install to complete.
wget http://layer1.cpanel.net/perl588installer.tar.gz
tar -xvzf perl588installer.tar.gz
cd perl588installer
./install
Upgrade MySQL4 to MySQL5 on cPanel server
Oct 21st
Upgrading MySQL versions is a quick and easy process, not much work involved. Always be sure to make a backup before you start though, just in case the upgrade fails or some other unforeseen issue arises.
cp -Rpf /var/lib/mysql /var/lib/mysql.BAK
Login to WHM –> Tweak Settings –> MySQL -> 5.0 and Save settings
/scripts/mysqlup –force
/scripts/perlinstaller –force Bundle::DBD::mysql
/scripts/realperlinstaller –force DBD::mysql
Recompile PHP
You’re done
Disable root SSH access
Oct 20th
Allowing the root user to login directly is a major security issue, we’ll show you how to disable it so you can still login as root but just not directly, reducing the security issue.
This will force a hacker to have to guess 2 seperate passwords to gain root access.
(you do have 2 seperate passwords for admin and root right?)
What happens is you’ll first need to login as your admin user in SSH, then switch to the super user with the su command to get root.
We also will be forcing the use of SSH protocol 2, which is a newer, more secure SSH protocol
Just a couple more ways to help your server stay safe from the bad guys. If you’re using cPanel make sure you add your admin user to the ‘wheel‘ group so that you will be able to ‘su -‘ to root, otherwise you may lock yourself out of root.
1. SSH into your server as ‘admin‘ and gain root access by su
2. Copy and paste this line to edit the file for SSH logins
pico -w /etc/ssh/sshd_config3. Find the line
Protocol 2, 14. Uncomment it and change it to look like
Protocol 25. Next, find the line
PermitRootLogin yes6. Uncomment it and make it look like PermitRootLogin no
7. Save the file Ctrl+X then Y then enter
8. Now you can restart SSH
/etc/rc.d/init.d/sshd restart
Now, no one will be able to login to root with out first loggin in as admin and ’su -’ to root, and you will be forcing the use of a more secure protocol. Just make sure you remember both passwords!