Saturday, February 14, 2015

SCP copy files between servers

SCP files from local to server

Just a file

$ scp /path-file user@server:/path/

copy a directory
$ scp -r /path-dir user@server:/path/


SCP files from server to local
  On the same local machine

$ scp user@server:/path-file-located /path-to-save-in-local

Command line to execute ssh with password authentication

$ ssh user@server
  output:
  user@server's password: []

Install sshpass and can try this

sshpass -p "server-password" user@server

Copy files, SCP files without prompting for password or 
Command line to execute scp with password authentication

SCP files from local to server
$ sshpass -p "server-password" scp /path-file-to-copy user@server:/path-to-saveon'

No comments:

Post a Comment

CSS tricks

Mixed paint in background: background: linear-gradient(to right, #b6e358, #38b143) Grid view: display: grid; grid-template-columns: a...