File System

  • /bin - basic programs (ls, cd, cat, etc.)

  • /sbin - system programs (fdisk, mkfs, sysctl, etc)

  • /etc - configuration files

  • /tmp - temporary files (typically deleted on boot)

  • /usr/bin - applications (apt, ncat, nmap, etc.)

  • /usr/share - application support and data files

Adding to PATH

#1. Open ~/.bashrc with an editor of your choice.

 vi ~/.bashrc

#2.At the very end of the file, add the JDK bin directory to the PATH variable:

export PATH=<path of extracted JDK dir>/bin:$PATH

#3.Save file
#4.Restart any open terminal windows for changes to take effect 

File Permissions

User

Group

Everybody Else

-rwx

r-x

r-x

  • -r : 4 bits

  • -w : 2 bits

  • -x : 1 bit

  • -t : Sticky bit : The sticky bit only allows the user who created a file in this directory (or the owner of the directory, ie: root) to modify this file.

  • -s: SUID Bit :-When a command or script with SUID bit set is run, its effective UID becomes that of the owner of the file, rather than of the user who is running it.

    • If a capital “S” appears in the owner’s execute field, it indicates that the setuid bit is on, and the execute bit “x” for the owner of the file is off or denied.

  • Total: 7 bits. [eg: chmod 777]

SUID bit: Runs files with the permissions of a specified user.

  • SUID bit [s] replaces x for User

  • SGID bit [s] replaces x for Group. SGID on a directory, is inhretied by all files within the directory.

  • Sticky bit: [s] replaces x for All

#Keys need to be only readable by you:
chmod 400 ~/.ssh/id_rsa
#If Keys need to be read-writable by you:
chmod 600 ~/.ssh/id_rsa

User ID [UID]

  • Real ID: ID defined within /etc/passwd.

  • Effective ID: Normally equal to their real ID, however when executing a process as another user, the effective ID is set to that user’s real ID. The effective ID is used in most access control decisions to verify a user, and commands such as whoami use the effective ID.

  • Saved ID: Used to ensure that SUID processes can temporarily switch a user’s effective ID back to their real ID and back again without losing track of the original effective ID.

Sharing Files with Vmware and Windows Host

Last updated