Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. @echo off
  2.  
  3. :: OpenSSH Private Key File
  4. set KEY_PATH=C:\\Users\\GokulNC\\Desktop\\Keys\\GCP_VM\\id_rsa
  5. set USERNAME=GokulNC_GCP
  6. set REMOTE_DIR=/
  7.  
  8. set /p IP=Enter the IP:
  9. set /p DriveLetter=Enter the mount drive letter:
  10.  
  11. set CYGFUSE=WinFsp
  12. set PATH=C:\Program Files (x86)\SSHFS-Win\bin;%PATH%
  13. sshfs.exe -ofstypename=SSHFS -o idmap=user -o umask=000 -o volname=%IP% -o Compression=no -o reconnect,ServerAliveInterval=120 -o IdentityFile=%KEY_PATH% %USERNAME%@%IP%:%REMOTE_DIR% %DriveLetter%:
  14.  
  15. :: Wait a few secs for it to become stable
  16. timeout 3 >NUL
  17. echo.
  18. echo.
  19.  
  20. IF EXIST %DriveLetter%:\ (
  21. echo Connected to %USERNAME%@%IP% successfully and mounted %REMOTE_DIR% at %DriveLetter%:\
  22. echo.
  23. echo Minimize this window and continue browsing your remote host's FS.
  24. echo To terminate the connection, close this window.
  25. ) ELSE (
  26. echo Connection FAILED! Close this window.
  27. )
  28.  
  29. pause >NUL
  30. pause >NUL
  31. echo Connection terminated. Close this window.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement