James Emmrich

31 Mar, 2011

Mount Remote Filesystem Over ssh

Posted by: James In: Linux|Miscellaneous|ProTip

Here is a nice tip when having to access remote files. Whether it’s a personal computer or a device somewhere running an ssh server, sometimes it’s great to use those files as if they were local.

I use this for sharing my media collection between computers outside of my local network.

 

Install the Packages

apt-get install sshfs

 

Mount the Remote Filesystem

sshfs james@james.dyns-home.com:/home/james/music /home/james/music

As you can see here, I am using dyndns’s service so that my home pc’s dynamic IP is always accessible. I suggest checking them out and installing the ddclient package to maintain your dyndns account.

 

Unmounting the Remote Filesystem

fusermount -u /home/james/music

 



Tweet This

Here is a handy script I made for those situations where you are logged into a user account but require running a program as another user.

Why would this be handy? Well in my case, I have two users on my laptop. My personal account which I use at home, and my work account. This helps me keep my work data separate from my personal data. But how do I use my instant messenger or IRC chat and retain chat logs and preferences without having to duplicate them or create weird symbolic links everywhere?

The bash script:

#!/bin/bash
xhost +
gksudo -u $1 $2
xhost -

Set the permissions to for executing:

chmod +x AppAsDiffUser.sh

The script takes two arguments, the user you want to run as and the application you want to run. Now we can run the script:

./AppAsDiffUser.sh james xchat

 

 



Tweet This

The reason I love Brother laser printers & multi-function laser printers is Brothers support for Linux operating systems.

If you have a multi-function laser printer, you can enjoy scanning and printing from Linux over the network or by USB just like our Windows friends.

The Brother HL-2170W is just a simple laser printer, with built in wireless and a wired network port as backup. Here is how to install it.

First thing you need is to download the drivers to your desktop:

  1. brhl2170wlpr-2.0.2-1.i386.deb
  2. cupswrapperHL2170W-2.0.2-1.i386.deb

Since I am pretty much only going to use the wireless connectivity, I configured it directly over wireless, I have a spare windows laptop which I used. I installed the drivers on it as I use this laptop for my windows development and graphics editing. To do the configuring, I had to connect to the Ad-hoc network SETUP which I assume is the printers default SSID. Once the printer is configured this connection disappears. I had to hold the GO button on the printer for 10 seconds to get a printout of the current configuration. Don’t get me wrong, Brother does not require you to use a Windows computer to set this device up!

Anyways, with the printer setup for networking, time to set up Ubuntu from command line:

cd ~/Desktop
sudo aa-complain cupsd
sudo mkdir /usr/share/cups/model
sudo ln -s /etc/init.d/cups /etc/init.d/lpd
sudo mkdir /var/spool/lpd
sudo dpkg  -i  --force-all brhl2170wlpr-2.0.2-1.i386.deb
sudo dpkg  -i  --force-all cupswrapperHL2170W-2.0.2-1.i386.deb

Make sure that it is installed:

dpkg  -l  |  grep  Brother
ii  brhl2170wlpr  ....  2.0.2-1  ....  Brother HL-2170W LPR driver
ii  cupswrapperhl2170w  ....  2.0.2-1  ....  Brother HL2170W CUPS wrapper driver

Depending on the current state of your computer you might have to reboot.

Now add and configure the printer
http://localhost:631/

I have two printers connections installed for this printer, one for over networking, and one setup as USB. I wasn’t paying attention when I set this up ha, I think it did it auto-magically.

Once the printers are setup, go into System > Administration > Printing

Right click on the networking printer and click Properties.

Make sure that the Device URI is correct. For me, since I use static IP’s on my network I had to remove the device name and put in the IP address like so:

lpd://192.168.1.29/BINARY_P1

That’s it. I hit Print Test Page and it worked, as expected!

I recommend Brother printers to anyone, this printer was pretty cheap and they all use virtually the same cartridges and drums so you can swap with your other Brother devices when in a pinch.



Tweet This

Categories

Upcoming Events

  • Mon, Mar 12:CMRC Pro National - The Wastlands
  • Sat, Mar 24:Supercross Toronto
  • Thu, May 10:CMRC Pro National - Whispering Pines Raceway?????
  • Sun, Jun 17:CMRC Pro National - Wild Rose MX Park
  • Sun, Jun 24:CMRC Pro National - Castrol Raceway
  • Wed, Jul 4:CMRC Pro National - Riverglade MX Park
  • Sat, Jul 14:CMRC Pro National - Gopher Dunes Raceway
  • Sun, Jul 22:CMRC Pro National - Ste Julie
  • Tue, Aug 7:CMRC Pro National - Sand Del Lee
  • Mon, Aug 13 – Sun, Aug 19:Walton TransCan

Flickr PhotoStream

    Guess Misty doesn't want me to finish my refundsFortune cookie for the developerDrew and i at motoparkLol mistyMontreal SupercrossAuburn Hills Aug 31 2008Auburn Hills Aug 31 2008Auburn Hills Aug 31 2008Auburn Hills Aug 31 200827000km milestonePissing at Transcan 2008x7-29-7-1360

Twitter Me

I'm a totally rad web application developer, linux affectionado, and a super hardcore motorcycle enthusiast. I'm self employed and have big ideas and big dreams.


Twitter Updates