-
Notifications
You must be signed in to change notification settings - Fork 148
How to Install tmate slave on CentOS 6.6
###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 wget
Check if libevent is installed and the version. We need libevent2
# rpm -qa | grep libevent
libevent-devel-1.4.13-4.el6.x86_64
libevent-doc-1.4.13-4.el6.noarch
libevent-headers-1.4.13-4.el6.noarch
libevent-1.4.13-4.el6.x86_64
If the version is older, remove it
yum remove libevent libevent-devel libevent-headers
Download libevent2
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar xf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
Compile it and install
./configure && \
make && \
make install
Create a symbolic link if you are on a 64-bit server
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
###2- Installing tmate-slave
Now download tmate-slave
git clone https://github.com/nviennot/tmate-slave.git
Change into the new directory and create the SSH keys
cd tmate-slave/
Save the 3x keys (dsa, rsa and ecdsa)
The key fingerprint is:
Install tmate-slave
./autogen.sh && \
./configure && \
make && \
make install
###2- Configure tmate-slave
setup tmate-slave user
useradd tmate-slave
setup tmate-slave config
mkdir /etc/tmate-slave
./create_keys.sh
install -D -m 0700 -o tmate-slave -g root keys/* /etc/tmate-slave/keys
chmod 0700 keys
touch /var/log/tmate.log
chown tmate-slave /var/log/tmate.log
setcap CAP_SYS_ADMIN=ep /usr/local/bin/tmate-slave
###3- Starting tmate-slave
If SSH is running, select another port and start tmate
sudo -u tmate-slave /usr/local/bin/tmate-slave -k /etc/tmate-slave/keys -l /var/log/tmate.log -p 2222 &
###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
tmate-slave make编译失败 tmate-ssh-server.c: In function ‘prepare_ssh’: tmate-ssh-server.c:349:29: error: ‘SSH_BIND_OPTIONS_IMPORT_KEY’ undeclared (first use in this functio n) ssh_bind_options_set(bind, SSH_BIND_OPTIONS_IMPORT_KEY, rsakey); ^ tmate-ssh-server.c:349:29: note: each undeclared identifier is reported only once for each function i t appears in