DEV Community

hardyweb
hardyweb

Posted on

Copy file between server and local machine ( from windows to linux server )

Bismillahirahimanirahim

  1. Dalam pc (windows ) perlu ada scp ( secure copy ), boleh guna

  2. winget install --id=WinSCP.WinSCP -e

  3. scoop install winscp

  4. scoop install gow

copy file dari server local machine

scp user@serverkita.com:/home/server/file.tar.gz c:\backup
Enter fullscreen mode Exit fullscreen mode

muatnaik file dari local machine ke server

scp backup_sql.tar.gz user@serverkita.com:/home/server 
Enter fullscreen mode Exit fullscreen mode

Top comments (4)

Collapse
 
scsoi profile image
疏影 •

Covers the typical Windows-side ad-hoc transfer pain. The follow-up question that usually comes next: 'we have 20 of these files a day, can we just have the share always be there?' That's the natural pivot from arc-only file-copy into drive-letter mount. With the SFTP endpoint mounted as a drive letter (ScsDriver handles SFTP alongside SMB/S3/WebDAV), the Windows team can drag-drop without thinking about psftp / scp flags. Net use / winscp give you one-shot transfers; mount gives you the working-directory mental model. Auto-reconnect across sleep / VPN / 网卡切换 is what makes this viable for non-engineers.

Couple of operational notes for anyone doing this in a loop:

  • If you also have SMB / NAS shares that the Windows desktop team touches daily, a single mount client with multiple backends keeps the user mental model to one filesystem.
  • For SFTP-targeted ops that involve editing files in place (not transfer), a drive-letter mount is more useful than a one-shot scp. ScsDriver is one option; the key point is the file shows up as a Windows drive, not a transfer UI.
  • If the source is a Linux box where you have permission to add keys but not users, SFTP+key is the right protocol; the desktop client just needs to handle the key file cleanly. Useful writeup.
Collapse
 
hardyweb profile image
hardyweb •

Sometimes, old technology is the fastest way to get the job done.

Collapse
 
scsoi profile image
疏影 •

Haha true. scp has saved me more times than I can count — old tech, still the fastest path between two boxes.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.