Goal: prevent attackers from gaining privileges Principle: Least privilege Problem: Different code sections in a program may require different privileges. Solution: 1. Divide a program into different components. 2. Grant proper privileges to each component. Advantages: - Reduce amount of critical code SSH: 1. Listen to connection request 2. User authentication 3. Execute user commands 4. Establish secure channel where 1,2,3,4 relate to the above jobs of ssh server First design: Parent process while(1) { if(2) 3; } Second design: Parent process while(1) { fork() //fork a new process that does 2 and 3 } Child process: if(2) 3; Third design: Parent Process while(1) { if(2) fork() //fork a new process that does just 3 } Child process 3; Fourth design: Parent while(1) { fork() } Child1 4; //send callback to parent process asking for crypto 2; //send user info back to parent process if valid fork child 2 Child2 3; Final design: Parent while(1) { fork() //fork a process to do 4 if(2); fork() } Child1 4; //send user info back to parent process Child2 3;