πŸ“€ Uploading/Sending a Directory from Local to SSH Server

Use either of the following commands:

scp -P 22 -r ./shell/* [email protected]:/home/gnu/shell/

OR

scp -r -P 22 ./shell [email protected]:/home/gnu/shell/

πŸ“₯ Downloading/Receiving a Directory from SSH Server to Local

scp -P 22 -r [email protected]:/home/gnu/* ./gnu/

OR

scp -r -P 22 [email protected]:/home/gnu ./gnu/

πŸ“€ Uploading/Sending a File from Local to SSH Server

scp -P 22 ./shell.php [email protected]:/home/gnu/shell.php

πŸ“₯ Downloading/Receiving a File from SSH Server to Local

scp -P 22 [email protected]:/home/gnu/flag.txt ./flag.txt

πŸ“ Note:

  • -P 22: Specifies the SSH port (22 by default)
  • -r: Recursively copy entire directories
  • Replace 192.168.0.20 with the target server’s IP
  • Replace u0_a418 with the correct SSH username