Tuesday, October 8, 2013

Run X Applications Over Network Using SSH

Topology:
Linux-based PC: 192.168.1.1
Linux-based Laptop: 192.168.1.7

In PC, you edit /etc/ssh/sshd_config using any editor you like:
$ sudo vi /etc/ssh/sshd
Looking for this line, or you can add if it's not already there:
X11Forwarding     yes
Save that file and restart SSH service:
$ sudo /etc/init.d/ssh restart
Allow Laptop to run X applications:
$ xhost 192.168.1.7
Define default display:
$ export DISPLAY=192.168.1.1:0

Then from Laptop terminal, run the command to execute any X applications you like:
$ ssh -X [username]@192.168.1.1 firefox
$ ssh -X [username]@192.168.1.1 oowriter

That's it! :)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Wednesday, October 2, 2013

Change Group Owner For /var/www

Taking another note. Here's how to change group owner for /var/www directory in Ubuntu Server 12.04. By default that directory meant to be DocumentRoot for Apache 2 web server and own by root. This practice is useful if we want to share the access to several people in webmaster group.


sudo addgroup webmasters

sudo chgrp -R webmasters /var/www

sudo find /var/www -type d -exec chmod g=rwxs "{}" \;
sudo find /var/www -type f -exec chmod g=rws "{}" \;

sudo gpasswd --add user webmasters
sudo gpasswd --add colleague1 webmasters
sudo gpasswd --add colleague2 webmasters
# etc.