Posts Tagged ‘Ubuntu’

History

There are times where I run a command that I needed to only need it again at a later time.  Most of the time I document my steps, but there are those time where I just do things in the heat of the moment to get what I need done.  So what can one do?  Well when you’re in your command shell and looking for that command you once knew, all you need to do is simply type:  history

History will return a log of all the commands you have typed.  So when in doubt, look back at your history and bring back those lost memories.  Good luck

Mounting a remote file system using ssh (sshfs)

For some time I have always used tools such as scp sftp to copy files between Linux based systems. Until the growing need to have this process simplified.  I recently fell in love with Linux all over again with the new release of Ubuntu.  I always had known it was possible but never had the direct need to mount ssh file systems remotely.  This is where some Google searching and SSHFS and FUSE came into play on my home systems.

So what are some things I found out?  Well for one; as long as I have SSH access to a remote system I can use SSHGS to mount and use the remote directories as if they were on my local system.  SSHGS require no special software on the remote host so this is good in a hosted situation where you have no control over what gets installed.

This is where I give you the * filler * info on SSHFS.

SSHFS is built upon the FUSE user-space file-system framework project.  FUSE allows user-space software; in my case SSH to present a file-system that is virtually interfaced to the end use.  SSHFS connect to the remote system and does all the necessary operations to provide the look and feel of a regular file-system.

So now what?

First we need to start off by installing sshfs if not already installed.  I am using Ubuntu like I had mentioned above so by typing sudo apt-get install sshfs that installs all I need and supporting requirement.

The fun part.

Create a local directory where you want the files mounted.  This process is similar to mount smb shares from another system.  In my example I will be mounting the directory /home on the remote server to a local path on my system:

“sudo mkdir /mnt/remotehome1”

“sudo sshfs jermsmit.com:/home /mnt/remotehome1

You can also change the owner of the new directory by typing chown ‘yourusername’ /mnt/remotehome1

Please note that the /mnt/remotehome1 directory must exist and be owned by you, so keep in mind when you make (for example) /mnt/remotehome1/ you should assign permissions to your user so that you may access it.

To unmounts the directory, you can use the command fusermount –u.  Example fusermount –u /mnt/remotehome1.  If you get a message about the path being in use make sure that you have change directory out of this path and try again.

That’s about it.  Very clean and simple, and next time I hope to write about setting this up in such a way its auto mounted on startup (aka persistent), but for now this gets the job done.

HowTo: VMware Tools in Ubuntu 10

Again I am working on my server; a virtual machine powered by VMware.  I recalled that I did not have the tools installed; also the virtual server console gave me an additional reminder.  So I decided to install.

There are a few things to do before installing.  First we need to make sure our server (Ubuntu) has compiler tools installed.  Then we must mount the virtual cd containing the VMware drivers and software tools for Linux.  From the command line terminal (I recommend doing this from the local console) as the network tools will drop you from the SSH connection.

Steps

sudo aptitude install build-essential linux-headers-$(uname -r)
cp -a /media/cdrom/VMwareTools* /tmp/
cd /tmp/
tar -vxzf VMwareTools*.gz
cd vmware-tools-distrib/
sudo ./vmware-install.pl

You will be asked a bunch of questions; I personal just accept the defaults and (press ENTER) to each one of them.  When completed, I reboot my server and that is it.  Tools are installed.

Return top