Topics

ssh

Watch log files on Linux server with Swatch 3.2.3

– Make sure to check CentOS, PHP-FPM, memcached and MYSQL posts.

– get a fresh package from Swatch project

wget "http://downloads.sourceforge.net/project/swatch/swatch/3.2.3/swatch-3.2.3.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fswatch%2F&ts=1330806322&use_mirror=garr"
tar xfz swatch-3.2.3.tar.gz 
cd swatch-3.2.3
cpan -i Date::Format File::Tail
cpan -i Date::Manip Date::Calc
cpan -i Test::Inter Test::Pod Test::Pod::Coverage Module::Build
cp /root/.cpan/sources/authors/id/S/SB/SBECK/Date-Manip-* .
tar xfz Date-Manip-*.tar.gz
cd Date-Manip-*
perl Build.PL 
./Build install
cd ..
perl Makefile.PL
make install

– configure swatch

Change SSH port and enable X11 forwarding

Check Installing CentOS 6.2 on VMware post.

– configure ssh port

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.old
vi /etc/ssh/sshd_config
#uncomment port 22 and change to
port 4568

– enable X11 forwarding

#install needed libraries
yum -y install xorg-x11-xauth xorg-x11-fonts-base liberation-fonts

vi /etc/ssh/sshd_config
#add
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

– restart sshd

 /etc/init.d/sshd restart

Now you should connect to 192.168.126.128:4568

Configuring iptables on CentOS

– disable SELINUX

vi /etc/selinux/config
#change
SELINUX=disabled

– reboot or run

 setenforce 0

– add iptables rules

Change server hostname

Check Installing CentOS 6.2 on VMware post.

Adding Hostname to Linux server

vi /etc/hosts
# add
127.0.0.1  localhost.localdomain localhost
192.168.126.128 centos6.vmware.local
vi /etc/sysconfig/network
#change
HOSTNAME=centos6.vmware.local
hostname centos6.vmware.local

Remotley start programs on your Linux Desktop

It is very easy to start programs remotely on your windows desktop from another computer but running X11 application on Linux from another ssh session would start a new X11 session on your remote machine, that was a problem for me and here is how I solved that…..