Back to DevOps Series

File Transfer — FTP, SCP

1. scp — Secure Copy

Copy local → remote:
Loading...
Copy remote → local:
Loading...
Copy directory:
Loading...
Specify SSH port:
Loading...
  • Uses SSH.
  • Encrypted and secure.
  • Good for simple file transfers.

2. ftp — File Transfer Protocol

Connect to FTP server:
Loading...
Common commands:
Loading...
FTP is not encrypted. For secure transfers, prefer scp or sftp.

3. sftp — Secure FTP

Loading...
Common commands:
Loading...
Important: sftp is often preferred over FTP because it works over SSH.

File Permissions

1. View Permissions

Loading...
Example:
Loading...
Permission groups:
Loading...

2. Permission Types

Permission
Symbol
Value
Read
r
4
Write
w
2
Execute
x
1
No permission
-
0
For directories:
  • r → List contents
  • w → Create/delete/rename files
  • x → Enter/traverse directory

3. chmod — Change Permissions

Symbolic:
Loading...
  • u → User/owner
  • g → Group
  • o → Others
  • a → All
Numeric:
Loading...
Example:
Loading...

4. chown — Change Owner

Loading...
Change owner and group:
Loading...
Recursive:
Loading...

5. chgrp — Change Group

Loading...
Recursive:
Loading...

6. Check File Ownership

Loading...
Detailed information:
Loading...

7. Default Permissions — umask

View:
Loading...
Set temporarily:
Loading...
  • Controls default permissions for newly created files/directories.

8. Special Permissions

SUID:
Loading...
SGID:
Loading...
Sticky bit:
Loading...
Common numeric forms:
Loading...

⭐ Important Commands

Command
Purpose
ftp
Unencrypted FTP transfer
scp
Secure file copy over SSH
sftp
Secure interactive file transfer
ls -l
View permissions/ownership
chmod
Change permissions
chown
Change owner
chgrp
Change group
stat
Detailed file information
umask
Set default permissions
sudo
Run command with elevated privileges
Remember:
scp = Secure Copy
sftp = Secure File Transfer
chmod = Change permissions
chown = Change owner
chgrp = Change group