A chronological documentation test project, nothing serious, really!

13 Apr 2008 Mount remote filesystem using ssh and sshfs

This is short howto on how you can mount a remote filesystem through ssh and access in Debian it like any other local filesystem. This is a safer method to mount remote filesystems and a user can perform it without root privileges.

First you need to install sshfs

# aptitude install fuse-utils sshfs

Install the necessary kernel module

# modprobe fuse

If you haven’t installed the ssh server package already, now is the time

# aptitude install ssh

Mounting a remote filesystem is easy

sshfs username@hostname: mountpoint


create the mount point

# mkdir /mnt/remotefilesystem
# chown [username]:[groupname] /mnt/remotefilesystem/

Add yourself to the newly created fuse group

adduser [your-user] fuse

switch to your user and mount the remote filesystem.

sshfs remote-user@remote.server:/remote/directory /mnt/remote/

You can specify any directory after the colon.

$ sshfs [user@]host:[dir] mountpoint [options]

If you want to unmount your directory use the following command

fusermount -u mountpoint

Tags: , , ,

Posted by

25 Mar 2008 aptitude cheatsheet

aptitude is a great alternative to apt-get and the best way to install, remove, upgrade, and otherwise administer packages on you system with apt. aptitude solves orphaned dependencies and has a curses interface that blows the doors off of dselect. Finally, and most importantly, it takes advantage of one tool, doing many many operations:

Syntax Description
aptitude Running it with no arguments brings up a curses based interface to search, navigate, install, update and otherwise administer packages
aptitude install Installing software for your system, installing needed dependencies as well
aptitude -d install Download packages to the package cache as necessary, but do not install or remove anything.
aptitude remove Removing packages as well as orphaned dependencies
aptitude purge Removing packages and orphaned dependencies as well as any configuration files left behind
aptitude search Search for packages in the local apt package lists
aptitude update Update the local packages lists
aptitude upgrade Upgrade any installed packages that have been updated
aptitude clean Delete any downloaded files necessary for installing the software on your system
aptitude dist-upgrade Upgrade packages, even if it means uninstalling certain packages
aptitude show Show details about a package name
aptitude autoclean Delete only out-of-date packages, but keep current ones
aptitude hold Fix a package at it’s current version, and don’t update it

aptitude uses many of the same commands as apt-get. It is not a good idea to use both, you should either use aptitude or apt-get exclusively, or your dependencies might get confused.

Tags: , , ,

Posted by

24 Mar 2008 Advantages using aptitude instead of apt-get

apt-get is a command-line package handling utility while aptitude is a high-level interface to the package manager. There isn’t much difference between the two except aptitude will remove unused package dependencies automatically whereas with apt-get you have to do it manually. Neither removes dependencies as that would cause problems. Dependencies are packages that are depended on by other packages. You don’t want to remove them.

To remove unused packages with apt-get use

sudo apt-get autoremove

With aptitude there is nothing to do as it’s automatic.

Tags: , , ,

Posted by

19 Mar 2008 dpkg command cheatsheet

Syntax Description Example
dpkg -i {.deb package} Install the package dpkg -i zip_2.31-3_i386.deb
dpkg -i {.deb package} Upgrade package if it is installed else install a fresh copy of package dpkg -i zip_2.31-3_i386.deb
dpkg -R {Directory-name} Install all packages recursively from directory dpkg -R /tmp/downloads
dpkg -r {package} Remove/Delete an installed package except configuration files dpkg -r zip
dpkg -P {package} Remove/Delete everything including configuration files dpkg -P apache-perl
dpkg -l List all installed packages, along with package version and short description dpkg -l
dokg -l | less
dpkg -l ‘*apache*’
dpkg -l | grep -i ‘sudo’
dpkg -l {package} List individual installed packages, along with package version and short description dpkg -l apache-perl
dpkg -L {package} Find out files are provided by the installed package i.e. list where files were installed dpkg -L apache-perl
dpkg -L perl
dpkg -c {.Deb package} List files provided (or owned) by the package i.e. List all files inside debian .deb package file, very useful to find where files would be installed dpkg -c dc_1.06-19_i386.deb
dpkg -S {/path/to/file} Find what package owns the file i.e. find out what package does file belong dpkg -S /bin/netstat
dpkg -S /sbin/ippool
dpkg -p {package} Display details about package package group, version, maintainer, Architecture, display depends packages, description etc dpkg -p lsof
dpkg -s {package} | grep Status Find out if Debian package is installed or not (status) dpkg -s lsof | grep Status

{package} – Replace with actual package name

Tags: , , ,

Posted by

27 Feb 2008 rpcbind and auth ports open

The last time I installed Debian Etch i closed both port 111 and 113 but since I’ve forgot it already and a new installation is in progress, this post should remind me how to do it in the future. The code view below shows the ports nmap found were in a open state

111/tcp open  rpcbind
113/tcp open  auth

Port 113/auth can be closed by commenting out the ident line in the /etc/inetd.conf

#ident          stream  tcp     wait    identd  /usr/sbin/identd        identd

Port 111 is the portmap daemon and can be configured to only listen on the loopback interface

dpkg-reconfigure portmap

This command modifies the /etc/default/portmap file and adds/uncomments the line


Tags: , , , ,

Posted by