Saturday, June 13, 2009

Setup more than one sshd daemon in one box

You have one Linux server and want to set two ssh daemon, may be two different ssh servers each with a different version.

1) Download the openssh from http://www.openssh.org/portable.html

2) Configure and make the sources:
# ./configure --with-kerberos5 --with-tcp-wrappers --with-pam
# ./make

2.1) Common errors:
"configure: error: PAM headers not found"
Solution: yum install pam-devel

3) You can do a "make install" but i wouldn't do that if you have already an ssh daemon installed, from sources or any package manager like rpm or apt.

4) Copy the ssh daemon directory or link to it from /usr/local/sbin/
# ln -s ./openssh-new /usr/local/sbin/sshd-new/

5) Supposing that you already have a /etc/ssh/sshd_config file, then you have to create
another configuration file for the new ssh server, lets put it in another directory:
/usr/local/etc/ssh/sshd_config

And edit this sshd_config file and put there this line, or edit it if it already exists:
# This line specifies which port you want to use:
Port 2253

6) Create the ssh key files:
# ssh-keygen -t rsa -f /usr/local/etc/ssh/ssh_host_rsa_key
# ssh-keygen -t dsa -f /usr/local/etc/ssh/ssh_host_dsa_key

7) Make sure that in the startup script /etc/init.d/sshd2 you instruct the daemon where to find its key files, something like this:

# Some functions to make the below more readable
KEYGEN=/usr/local/sbin/openssh-5.2p1/ssh-keygen
SSHD=/usr/local/sbin/openssh-5.2p1/sshd
RSA1_KEY=/usr/local/etc/ssh/ssh_host_key
RSA_KEY=/usr/local/etc/ssh/ssh_host_rsa_key
DSA_KEY=/usr/local/etc/ssh/ssh_host_dsa_key
PID_FILE=/var/run/sshd2.pid
OPTIONS="-f /usr/local/etc/ssh/sshd_config"

8) Finally, start the new ssh server.
/etc/init.d/sshd2 start

Friday, June 12, 2009

Public key for is not installed

The .rpm package has been signed with a private key to provide nonrepudiation and integrity, basically, its genuinety. The package should be verified with the public key.

You can use rpm to install the package:

# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# yum install ./mysqlclient10-3.23.58-9.2.c4.x86_64.rpm

Tuesday, March 17, 2009

Creating a VIP on Linux

If you want to have two or more ip addresses on one physical interface, in Linux, there are many ways to do it, but to have a change permanent you have to do these steps on Redhat Linux and probably other distros:

Make a copy from the physical interface startup config file:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0

Modify the /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:53:52:A2:43:43
IPADDR=192.168.100.30
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
MACADDR=00:53:52:A2:43:43

Finaly, do a :
# ifup eth0:0

Saturday, December 13, 2008

/usr/lib64: file not recognized: Is a directory

I have seen this error several times when compiling and the solution is always the same:

Edit the Makefile and replace:
LDFLAGS = -L /usr/lib64
for:
LDFLAGS = -L/usr/lib64
(remove the space between the -L and /usr/lib64)

Friday, December 12, 2008

Error with PHP and Mysql

skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient

Seems that this errors come because of incompatibility between i386 and x64.

# cd /usr/lib/mysql
# ln -s ../../lib64/mysql/libmysqlclient.so

If this do not works, you can patch the Makefile to use the x64 version of the
libraries instead of the x32:

# sed -i -e 's@-L/usr/lib/mysql@-L/usr/lib64/mysql@g' Makefile


Error starting snmp on Centos.

/usr/sbin/snmpd: symbol lookup error: /usr/sbin/snmpd: undefined symbol: smux_snmp_select_list_get_length

Resolution:
yum update net-snmp-libs

Monday, August 25, 2008

The Linux Knowledge Base and Tutorial

Looking for an in-depth and easy-to-understand introduction to Linux? Then look no further!
We don't just show you how to execute a handful of commands and use a few utilities. The Linux Tutorial goes beyond the basics, providing you with the knowledge necessary to get the most out of your Linux system.

[...] Keep reading in: Linux Knowledge Base and Tutorial

Friday, August 22, 2008

100 Tips and Tools to Set Up Your Own Home LAMP Server

LAMP (Linux, Apache, MySQL and PHP) servers are very popular for their ease of use and flexibility. They’re also easy to initiate, because the components are easy to aquire and there’s a lot of documentation available to help with getting started. Read on to find some of the best resources available for creating your own home LAMP server, from installation to maintenance.
[...]
Keep reading in:
100 Tips and Tools to Set Up Your Own Home LAMP Server