Nov 21
If you have a server, but only want to allow users to copy files via sFTP without providing shell access. This can be done with rssh, a restricted shell for use with OpenSSH that allows only scp and/or sftp.
To install rssh
$ apt-get install rssh
By default rssh doesn’t allow anything, to allow only sftp modify the rssh.conf file.
$ nano /etc/rssh.conf
Uncomment the line for allowsftp and other transfer protocols you want to enable.
#allowscp
allowsftp
#allowcvs
#allowrdist
#allowrsync
To restrict a user to only allow sftp access, modify the /etc/passwd file
$ nano /etc/passwd
For example
ftp:x:100:100::/home/ftp:/usr/bin/rssh
Nov 04
Normally when I build a web application that connects to a MySQL database, I would place the mysql-connector-java-bin.jar file into the WEB-INF/lib of the web application.
However, when I deployed the application on Tomcat 5.5 on Ubuntu 8.04 I got an exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
I couldn’t find the reason which caused the exception, so I did a quick fix by placing the jar file into the Tomcat’s common lib directory.
$ cp mysql-connector-java-bin.jar /usr/share/java
$ cd /usr/share/tomcat5.5/common/lib
$ ln -s ../../../java/mysql-connector-java-bin.jar mysql-connector-java-bin.jar
Oct 28
RAR is a file format developed by Eugene Roshal, and one of the most popular format used for data compression and archiving next to the ZIP file format. By default, Ubuntu doesn’t have any support for extracting RAR files, however there is an available Linux freeware unrar for downloading.
To install unrar in Ubuntu
$ apt-get install unrar
The drawback with this utility is that it only supports the RAR and RAR2 format, but not the RAR3 format which can only be extract by RARLAB’s UnRAR which is not free.
Oct 21
Using apt-get is quickest and easiest way to manage Debian packages in Ubuntu. However, I would sometimes like to install the latest version of a package which is not available in the Ubuntu software repository. This can be done by downloading the Debian package (.deb) and using the dpkg command (which is what apt-get uses behind the scenes).
To install a .deb file
$ dpkg -i filename.deb
Other useful option available for dpkg:
Unpacks the file but does not install it
$ dpkg –unpack
Display configuration options are available for the package
$ dpkg –configure
Removes a package
$ dpkg –remove
To display the information for filename.deb
$ dpkg-deb –show filename.deb
Mar 26
I run my Xubuntu computer 24/7 a day, therefore it’s a good idea to be able to monitor the CPU and hard drive temperature. Not looking for something complicated, I decided to install an applet on the Xfce4 panel. The first hardware sensors applet I found was the xfce4-sensors-plugin package, however I didn’t find the graphics very appealing, therefore I decided to use the sensors-applet which displays hardware sensors readings in the Gnonme panel.
To get the sensors-applet working on the xfce4 panel, I had to install xfce4-xfapplet-plugin which allows Gnome applets to be plugged into the Xfce4 panel. If you have hddtemp (a utility to monitor the temperature of your hard drive) you can also display the readings in sensors-applet as well.
$ apt-get install xfce4-xfapplet-plugin
$ apt-get install hddtemp
$ apt-get install sensors-applet
