How to Install Telnet Client on CentOS 6.3

Telnet is most likely to be used by system administrators, program developers and anyone who has a need to use specific applications or data located at a particular host computer. It’s a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. Telnet does not installed automatically on CentOS 6.3. You can issue the following command to confirm that telnet is working :

telnet localhost 80

If telnet client does not installed, it should return something like :

[root@centos63 ~]# telnet localhost 80
-bash: telnet: command not found

Issue the following command to install telnet client :

[root@centos63 ~]# yum install telnet -y
Loaded plugins: fastestmirror, presto
Determining fastest mirrors
 * base: mirrors.hostemo.com
 * extras: mirrors.hostemo.com
 * updates: mirrors.hostemo.com
CentOS6.3-Repository                                                         | 4.0 kB     00:00 ...
base                                                                         | 3.7 kB     00:00
extras                                                                       | 3.0 kB     00:00
updates                                                                      | 3.5 kB     00:00
updates/primary_db                                                           | 2.2 MB     00:19
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.i686 1:0.17-47.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package           Arch            Version                    Repository                       Size
====================================================================================================
Installing:
 telnet            i686            1:0.17-47.el6              CentOS6.3-Repository             56 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 56 k
Installed size: 102 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 56 k
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:telnet-0.17-47.el6.i686                                                        1/1
  Verifying  : 1:telnet-0.17-47.el6.i686                                                        1/1

Installed:
  telnet.i686 1:0.17-47.el6

Complete!

If telnet client installed, it should return something like :

[root@centos63 ~]# telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.

Setting up DNS with Your Parallels Plesk 12 Server

There are three steps to setting up DNS for websites hosted on your Dedicated using Plesk 12:

  1. Add your domain name to the Parallels Plesk Panel.
  2. Create and register two domain hosts.
  3. Assign your nameservers to your registered domain name.

Step 1 — Adding Your Domain Name to Parallels Plesk Panel

Before you can use DNS with a domain name, you have to add it to Parallels Plesk Panel.

[stextbox id=”info”]NOTE: If you have already set up a domain name in Parallels Plesk Panel, you can skip this step. To Add a Zone File for Your Domain Name in Parallels Plesk Panel[/stextbox]

Log in to Parallels Plesk Panel as an administrator at https://yourserverip:8443, where yourserverip is your server’s IP address.
Go to the Webspaces tab, and then click Add a webspace.
Complete the on-screen fields, and then click OK.

NOTE: The username and password you select here are your FTP credentials for this domain/webspace.

Step 2 — Adding/Editing the DNS Records in Plesk for a Domain

Creating and registering domain hosts let you use a custom domain name as your DNS server name. To Create and Register Your Domain Hosts in Parallels Plesk Panel:

Log in to Parallels Plesk Panel as an administrator.
Go to the Websites & Domains tab, and then click DNS Settings.

For the row with the Record Type of NS, click your domain name, change the following, and then click OK:

Record type — NS.
Domain Name — Leave this field.
Name server — Type ns1.coolexample.com, where coolexample.com is your domain name.

Capture1

For the row with the Host of ns.coolexample.com, where coolexample.com is your domain, click it, change the following, and then click OK See above):

Record type — A.
Domain Name — Type ns1.
IP Address — Enter your server’s IP address.

After

Capture2

Next, click Add Record, complete the following fields, and then click OK:

Record type — Select NS.
Domain Name — Leave this field blank.
Name server — Enter ns2.coolexample.com, where coolexample.com is your domain name.

Next, click Add Record, complete the following fields, and then click OK:

Record type — Select A.
Domain Name — Type ns2.
IP Address — Enter your server’s IP address
Click Update.

After

Capture3

Go to the Server tab in Plesk, and then, from the Server Management section, click Services Management.
Next to DNS Server (BIND), click Restart. Allow a few minutes for the service to restart.

NOTE: DNS changes can take 24-48 hours to propagate.

Step 3. Registering your Nameservers

Once you set up a domain name and create a zone file in Parallels Plesk Panel, you need to create and register two domain hosts for your domain name. For more information, see Registering Your Own Nameservers/Hosts. If your domain name is registered with another company, you need to contact them for instructions regarding domain host registration.

NOTE: You can use the two domain hosts you just created for other domains hosted on the same server. You do not need to create new domain hosts for each of your domains.

Categories DNS

Database Upload Error Cpanel PhpMyAdmin

Editing the global php.ini at /usr/local/lib/php.ini does not increase values in the internal PHP for cPanel for PhpMyAdmin.

You have to edit the internal php.ini, which apparently it is reading from /usr/locafile.rather than /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini file.

nano /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
; Maximum size of POST data that PHP will accept.
post_max_size = 50M
upload_max_size = 50M

FTP login failed – 530 login incorrect

Cannot login via ftp to the domain, the following error is displayed during the logging:

530 Login incorrect.

In the ‘/var/log/secure’ file you may find the following error:

Oct 1 12:55:15 web02 proftpd[20205]: 127.0.0.1 (91.204.25.4[91.204.25.4]) – USER test (Login failed): Invalid shell: ‘/bin/false’

Cause

The string ‘/bin/false’ is missed in the file ‘/etc/shells’.
Resolution

Add ‘/bin/false’ to the ‘/etc/shells’ file
Search words:
FTP
Invalid shell
530 Login incorrect
Error 530
ftp error plesk

Categories FTP

Cisco VPN on CentOS 6

Install eplel repo


# rpm -ivh http://mirror.vcu.edu/pub/gnu+linux/epel/6/i386/epel-release-6-8.noarch.rpm


# yum -y install vpnc
# chmod 700 /etc/vpnc/vpnc-script
# cp /etc/vpnc/default.conf /etc/vpnc/default.conf.orig

Save your .pnc file from Networking to /etc/vpnc/ folder

Install the VPN .pnc file as a default.conf file

Get the pcf to vpnc configuration file converter


# wget http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc

Make it executable


# chmod +x pcf2vpnc

Move it to a place in our path


# mv pcf2vpnc /usr/local/bin/


# cd /etc
# pcf2vpnc /path/username.pcf default.conf
# chown root:root default.conf
# chmod 600 default.conf

Edit the config file to either use your username and password, or to manually enter


# nano default.conf
# Uncomment for auto login
# Xauth username myusername
# Xauth password userpass
# Uncomment for manual login
Xauth interactive

Backup resolv.conf

As a final configuration step, it is a good idea to make a backup of your resolv.conf file. The vpnc program will replace the resolv.conf upon connection and will restore it when you disconnect.

Connect and Disconnect

You must be logged in as Root for this to work

# vpnc
# vpnc-disconnect

How can i know which account is usinig a lot of cpu or ram in my server?

For cPanel

Main >> System Health >> Show Current CPU Usage
It will show what user is taking most cpu. However, if you suPHP is not installed on your server, you will not able to see username. It will show you just nobody user.

remote ssh

Use “top –c” and nice top to find out the process that is causing high load on the server. Get the process id and then check who owns the process running in the server.

top --c
cd /proc/<process id>
ls -l 

The above command will give the link to the directory from which the script is running. Also try installing suphp in the server.

There are various ways to checkout the processes using high percentage of CPU and RAM, like

1) WHM >> Apache Status : it will show you each request to your website + it’s CPU and RAM usage.
2) ps -auxf : it will list all the current processes running on the server + it’s CPU and RAM usage
3) top c : same as above but shows a real time view of all the processes and resource usage

Load monitoring commands

1)top -c you will see the resource usage in percentage like Memory, CPU etc.Also server load details. And pstree -pua command list the processes in the server.
2) If say a user is listed high in the above command with higher resource usage the command

ls -alh /proc/<id> |grep cwd

Where is the process id of the user. This command gives the working directory of the script.
3) Check WHM interfaces
Main >> Server Status >> Daily Process Log
Main >> Server Status >> Apache Status

Some of the security tips that will help you is :-

1) enable suPHP
2) enable mod_security
3) also close some of the security holes in the php functions using the php disable_functions.

is there any command to show the Users with CPU and Memory usages ?
Use top -c d2 -u “username” as an example top -c d2 -u mylogwp

Categories Top

How do I include lines in resolv.conf that won’t get lost on reboot?

It’s probably better to have your DNS server be able to resolve ‘puppet’ to the right address, and either to have your DHCP server hand out the DNS nameserver address and search list or else (if you have static IP addresses) to have something like the following in /etc/network/interfaces.

iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
dns-search example.com
dns-nameservers 192.168.3.45 192.168.8.10

But if you do want to do it via the resolvconf configuration files you will want to edit /etc/resolvconf/resolv.conf.d/base. In that file, put in your info as you would in resolv.conf.

nameserver 192.168.1.XXX

Then tell resolvconf to regenerate resolv.conf.

sudo resolvconf -u