Saturday, November 15, 2014

How to Install tmate Server on CentOS 6.5

1- Install required packages for tmate and for compiling

Use group install for development tools. It will install all the following pakcages for you: autoconf automake binutils bison flex gcc gcc-c++ gettext libtool make patch pkgconfig redhat-rpm-config rpm-build rpm-sign
# yum groupinstall 'Development Tools'
Then install other required packages for tmate
# yum install git kernel-devel zlib-devel openssl-devel ncurses-devel cmake ruby libssh-devel
Check if libevent is installed and the version. We need libevent2
# rpm -qa | grep libevent
If the version is older, remove it
yum remove libevent libevent-devel libevent-headers
Download libevent2
tar xf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
Compile it and install
make install
Create a symbolic link if you are on a 64-bit server
ln -s /usr/local/lib/ /usr/lib64/

2- Installing tmate-slave

Now download tmate-slave
# git clone
Initialized empty Git repository in /root/Downloads/tmate-slave/.git/
remote: Counting objects: 23464, done.
remote: Total 23464 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (23464/23464), 18.50 MiB | 17.14 MiB/s, done.
Resolving deltas: 100% (13397/13397), done.
Change into the new directory and create the SSH keys
# cd tmate-slave/ $$ ./ 
Generating public/private dsa key pair.
Your identification has been saved in keys/ssh_host_dsa_key.
Your public key has been saved in keys/
Save the 3x keys (dsa, rsa and ecdsa)
The key fingerprint is:
Install tmate-slave
# ./
# ./configure
# make

3- Starting tmate-slave

Move your tmate folder if you want. I have mine under $HOME/bin
[root@localhost bin]# mv ../Downloads/tmate-slave/keys/ .
If SSH is running, select another port and start tmate
# ./tmate-slave -k keys -l ../var/log/tmate.log -p 224 &

4- Configuring the client to use your server

Create $HOME/.tmate.conf with the following
set -g tmate-server-host "[your server FQDN]"
set -g tmate-server-port [server port]
set -g tmate-server-dsa-fingerprint   "dsa fingerprint"
set -g tmate-server-rsa-fingerprint   "rsa fingerprint"
set -g tmate-server-ecdsa-fingerprint "ecdsa fingerprint"
#set -g tmate-identity ""              # Can be specified to use a different SSH key

No comments: