Configuring SFTP CHROOT service


Let’s consider a situation where you need to configure a secure FTP service in your Linux server without installing any new packages to the system. Easy way of achieving this scenario is by configuring a SFTP CHROOT service in your Linux system. By Default all Linux systems are pre configured with SSH service. There for you only need to edit the existing configuration for this purpose.

1) Modify “/etc/ssh/sshd_config” file to reflect bellow changes

#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem       sftp    internal-sftp

Continue reading

Enable multiple users Read and Write permission for files within a folder

Lets assume we have two web developers working on the same web project and they will need a single shared location to store and collaborate their development work with each other. In bellow example I have taken “/var/web-dev” as the shared location and it’s owned by Apache user (www-data). Two developers, danny and penny, needs to store their development work in “/var/web-dev”.

Assuming we already has logins for danny and penny, we have to add them to Apache user group.

usermod -aG www-data danny
usermod -aG www-data penny

Continue reading

Installing softwares to RHEL5 without RHN subscription

To Install software to Red Hat 5 Enterprise Linux when your installation is not registered with Red Hat Network, simple solution is to install the software from the installation DVD.

If you have an ISO file of the installed OS version, mount it to /mnt/cd

Then create a file “iso.repo” in /etc/yum.repos.d

[base]
name=DVDROM
baseurl=file:///mnt/cd/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Adding Applications to System/Notification Area in Unity (11.04/11.10/12.04)

 

If you are using Unity version of Ubuntu and you want the you favorite programe (eg. Skype) run on your systems/notification tray, try the folowing method. It’s pretty simple and safe.

Open a command prompt and run the following command.

gsettings get com.canonical.Unity.Panel systray-whitelist

You may get a following list of application already running in the system/notification tray.

[‘JavaEmbeddedFrame’, ‘scp-dbus-service’]

With the above result you can enter the following command apppending the application you require in the system/notifction tray as follows,

gsettings set com.canonical.Unity.Panel systray-whitelist “[‘JavaEmbeddedFrame’, ‘Skype’, ‘scp-dbus-service’]”

That’s it… All you require a log off the current session and log back in.

Compress and Uncompress using TAR

I often fall into situation where I have forgotten how to uncompress a tar file, specially during a new application setting up. Since this method of compression is outdate (but still widely used) and I have made my self comfortable in using “zip”. Commands for compressing and uncompressing a tar file is just as simple as zip.

 

Below is an example of compressing a folder “mango” into “mango.tar.gz”. Atributes after the command, “c” compress, “z” zip, “f” file, “v” verbose. If you want “bzip” file after compression rather than “gz”, use “j” instead of “z”.

tar czvf mango.tar.gz mango/

For uncompressing a “tar” file, use “x” extract atribute as shown below,

tar -xzvf Mango.tar.gz

Zip a File or a Folder in Linux CLI

I often require to compress large files or folder to port between servers and often find myself wondering the commands compress them. I usually use “zip” command command to accomplish my task. Option “-9” is used for best compression. This compression is compatible with Microsoft Windows too.

To zip a folder:

zip -9 -r <zip file> <folder name>

To zip a single file:

zip -9 <zip file> <filename>

Configuring a Subversion server with Apache2 and DAV

Subversion is very popular software version and revision control system where developers can maintain current and previous versions development work. It’s gradually replacing the old Concurrent Versions System (CVS) and provide more sophistic set of features to developers. In this article I will explain you how to configure a Subversion (svn) server which uses Apache2 and DAV module. Also I presume that you have a running Apache2 service in your server.

Continue reading

How to setup a Mirrored Subversion repository

Releases after 1.4 in Subversion saw the introduction of a new tool “svnsync” which was very useful in creating two synchronized svn repositories. It can be used on many different designs and the most simplest design was to create a mirrored repository of source repository as a backup. In this article I will describe a scenario where it is one step further on above mentioned design.

Continue reading