# ssh user@example.com cat /path/to/remotefile | diff /path/to/localfile -
Posted by Hans-Henry Jakobsen
This post describes how you can setup secure web browsing using Firefox3 and by setting up a SSH tunnel from your PC/host to a remote PC/host. Your PC will then act as a local SOCKS proxy and all applications that supports SOCKS5 interface to this port. This is a handy solution if you are on a untrusted net like a wireless connection. The solution can also be used in Thunderbird if you would like.
Note
It is important to note that it’s only the connection between your host and the remote host that is secure. It is also important to note that Firefox will do DNS queries to the untrusted netwoork. This can be fixed by opening the about:config page and change network.proxy.socks_remote_dns to true.
Start a SSH connection to a host that you want to proxy through. Use the -D option to specify a SOCKS5 port on your localhost. The port doesn’t really matter. Just make sure you use the same port in your SOCKS client application.
# ssh -D 3333 username@example.com
In Firefox select “Tools | Options… | Advanced | Network |Settings… button”.
Then select “Manual proxy configuration”. All you need to fill out is “SOCKS Host: Localhost”, “Port: 3333”, then select “SOCKS v5”.
Type in “localhost” in the SOCKS host field and press the OK button.
You are now ready to surf using Firefox3 and SOCKS5 througt a SSH tunnel.
You can also use Putty if you are a Windows user. The configuration is then as follows:
Tags: firefox3, putty, SOCKS5, ssh
Posted by Hans-Henry Jakobsen
Add the following line if your SSH login takes a long time on your SSH server.
File /etc/ssh/sshd_config:
UseDNS no
Restart the SSH daemon to activate this change.
Tags: ssh
Posted by Hans-Henry Jakobsen
This post describes how to mount a remote filesystem through SSH using the shfs kernel module on a Debian Etch server. By doing this I can access the remote filesystem as if it was a local filesystem and also use my local tools and software.
This is a short description of how I made a remote filesystem accessible on my private server.
Download the needed software
# apt-get install shfs-source shfs-utils module-assistant
This step might not be needed on your system, but I didn’t have the needed software to build the kernel module
# module-assistant prepare
Use the module assistant to build the kernel module to match your local system (I use a 2.6 kernel but this whould work on a 2.4 kernel also)
module-assistant build shfs
Now you can install it
# module-assistant install shfs Selecting previously deselected package shfs-module-2.6.18-5-686. (Reading database ... 78212 files and directories currently installed.) Unpacking shfs-module-2.6.18-5-686 (from .../shfs-module-2.6.18-5-686_0.35-6.2+2.6.18.dfsg.1-17_i386.deb) ... Setting up shfs-module-2.6.18-5-686 (0.35-6.2+2.6.18.dfsg.1-17) ...
You might see some error messages but those are mostly harmless :) and can be ignored.
Now we can try to mount the remote filesystem
# mkdir /export/remotefs # shfsmount user@remotesystem.com /export/remotefs Password:
The remote filesystem should now be available after typing your password.
# cd /export/remotefs # ls
You will now see all your files in the remote filesystem as if they were on your local machine.
To unmount your filesystem
# cd / # umount /export/remotefs
This post could have been extended to use passwordless
Tags: Debian, Etch, mount, ssh
Posted by Hans-Henry Jakobsen
This is a quick note of my custom putty settings in Windows
Category: Session
Connection type: SSH
Category: Window
Lines of scrollback: 20000
Category: Window > Appearance
Font: Lucida Console, 9-point
Font quality: ClearType
Gap between text and window edge: 3
Category: Window > Translation
Character set: UTF-8
Handling of line drawing characters: Unicode
Category: Window > Selection
Action of mouse buttons: xterm
Paste to clipboard in RTF as well as plain text: enabled
Category: Window > Colours
ANSI Blue: Red:74 Green:74 Blue:255
ANSI Blue Bold: Red:140: Green:140 Blue:255
Category: Connection
Seconds between keepalives (0 to turn off): 30
Category: Connection > SSH > X11
Enable X11 forwarding: enabled
X11 forwarding is enabled to to let me access remote X applications in Windows using Xming.
Posted by Hans-Henry Jakobsen