Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

Tuesday, December 18, 2012

Advertise SFTP on Network using Avahi

I just realized that I can broadcast / advertise my SFTP server to other computers connected to the network.

Go to /etc/avahi/services
and create a file named sftp.service, which contains:





   %h SFTP
 
   
      _sftp-ssh._tcp
      22
 



Now, you can see your SFTP server in Nautilus.

This guy has more complete list on what can be broadcast using avah i

Saturday, February 21, 2009

vnc over ssh

For those who like to use vnc to work with remote computer, you should be aware that the traffic is not encrypted. Please refer to tightvnc faq page for information about this. Just like what recommended in the faq, ssh is required to secure the traffic.

Create a tunnel between your local and remote computer, and one way to do this is:
$ ssh -CNT username@remote_computer -L 5901:127.0.0.1:5900

Now, simply set your vnc viewer to access localhost with port 5901.

An example of using vncviewer is:
$ vncviewer localhost:5901

Thursday, February 19, 2009

ssh tunneling

ssh tunneling

In the client execute:
$ ssh -N -D user@CompB

where CompB is the server

To use this ssh tunneling with internet browser, for example firefox, change the "Connection Settings", under "Manual proxy configuration", update the "SOCKS Host:" to localhost:any_free_port. Notice that any_free_port here must be the same one as the one used in ssh.

Opera browser does not have socks proxy configuration. One way to do it is by using "tsocks."
Install tsocks:
$ sudo apt-get install tsocks

edit /etc/tsocks.conf, and change
server = 127.0.0.1 # this is localhost
server_port = # again, this must match with the port used in ssh.

rsync + ssh => resumable download

rsync + ssh => resumable download

Sometimes ago, I felt the necessity of being able to resume my download from another computer, specially if the file is quite big. In this case, it's time to use rsync. Since mostly I use ssh to access remote computer, so I combine rsync with ssh.

Here's how to do it:
$ rsync --partial --progress --rsh=ssh user@server:/serverpath/to/file /localpath/to/file

Now, what if you need to use non-standard ssh port? Let's say you need to connect to ssh via port 7890. The command will be like the following:
$ rsync --partial --progress --rsh='ssh -p7890' user@server:/serverpath/to/file /localpath/to/file

The neat thing is that there is also progress indicator shown.