Welcome to WebmasterWorld Guest from 54.159.165.175

Forum Moderators: bakedjake

(tip) Easy way to scp files from remote server to laptop

Resolution of: Logged in host ip address?

   
4:00 am on Sep 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This post is an extension to/resolution of a previous post:
Logged in host ip address? [webmasterworld.com]
I finally got a little function going that will scp a file to your home machine from the remote machine you're interacting with:

function scpme()
{
scp $1 username@${SSH_CLIENT% * *}:./$2
}

This goes in .bashrc and the usage is
scpme foo.txt
or
scpme foo.txt foo-othername.txt

On the same note you can easily set the display with:


alias displayon='export DISPLAY=${SSH_CLIENT% * *}:0.0'

The ${SSH_CLIENT% * *} gets just the IP part from the $SSH_CLIENT variable.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month