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

Thursday, July 25, 2019

Compress a file before scp from remote server to local


ssh user@host "tar -zcvf - -C /path/to/dir filename" | tar -zxvf -

Note: only use when it's much faster to transfer a compressed file to your machine than transferring the original one.

Credits:
https://superuser.com/a/1354868
https://stackoverflow.com/a/3035446/1032449

Saturday, February 23, 2013

SSHFS - Mount remote directory through gateway machine


  1. Expose target target server ssh port with ssh local port forwarding
    $ ssh -C -N -L localhost:local_port:target:target_ssh_port gateway_user@gateway
  2. Mount with sshfs through the port just exposed
    $ sshfs target_user@localhost:/target_directory /mount_point -o port=local_port
Example:
$ ssh -C -N -L localhost:22222:tap-machine:22 tapvpn@company-vpn-host.org
$ sshfs tap@localhost:~/work /mnt/work -o port=22222



Wednesday, February 2, 2011

Disable SSH host key checking

I summarized this from Linux Commando: How to disable SSH host key checking

He suggested 3 approaches
  1. $ sed -i 3d ~/.ssh/known_hosts
  2. Use parameters
    * StrictHostKeyCheckin
    * UserKnownHostsFile
    ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no username@hostname
  3. Config file ~/.ssh/config (or /etc/ssh/ssh_config for global) & restart ssh
    Host 192.168.0.*
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null

Collectd PostgreSQL Plugin

I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...