def scp_to_remote(host, port, username, password, local_path, remote_path, limit='', log_filename=None, timeout=600, interface=None):
 if limit:
  limit = ('-l %s' % limit)
 if (host and host.lower().startswith('fe80')):
  if (not interface):
   raise SCPError('When using ipv6 linklocal address must assign', 'the interface the neighbour attache')
  host = ('%s%%%s' % (host, interface))
 command = ('scp -v -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=password -r %s -P %s %s %s@\\[%s\\]:%s' % (limit, port, local_path, username, host, remote_path))
 password_list = []
 password_list.append(password)
 return remote_scp(command, password_list, log_filename, timeout)

def scp_to_remote ( host , port , username , password , local_path , remote_path , limit = '' , log_filename = None , timeout = 600 , interface = None ) : if limit : limit = ( '-l %s' % limit ) if ( host and host . lower ( ) . startswith ( 'fe80' ) ) : if ( not interface ) : raise SCPError ( 'When using ipv6 linklocal address must assign' , 'the interface the neighbour attache' ) host = ( '%s%%%s' % ( host , interface ) ) command = ( 'scp -v -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=password -r %s -P %s %s %s@\\[%s\\]:%s' % ( limit , port , local_path , username , host , remote_path ) ) password_list = [ ] password_list . append ( password ) return remote_scp ( command , password_list , log_filename , timeout )
copy files to a remote host through scp .