16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Unix</strong> Security<br />

UID GID<br />

Process Eff. Real Eff. Real<br />

/bin/sh fred fred student student<br />

[300] [300] [200] [200]<br />

sendrnail mail fred spool student<br />

[6] [300] [3] [200]<br />

Sendmail Process<br />

- has permissions of <strong>the</strong> user "mail"<br />

- has permissions of <strong>the</strong> group "spool"<br />

- creates files owned by "root" and in <strong>the</strong> group "mail"<br />

- can change back to permissions of user "fred" or group "student" by making effective UID/GID equal to real<br />

UID/GID<br />

Daemons<br />

are alternatives to <strong>the</strong> setuid/setgid programs for<br />

providing secure access to system files.<br />

User's Client<br />

Process<br />

(Unprivileged)<br />

Daemon Server<br />

Process<br />

(Privileged)<br />

Daemon run's permanently, waiting to service requests from o<strong>the</strong>r non-privileged client processes.<br />

><br />

<<br />

Socket Connection<br />

<strong>Unix</strong> Host 1<br />

User's Client<br />

Process<br />

(Unprivileged)<br />

<strong>Unix</strong> Host 2<br />

Daemon Server<br />

Process<br />

(Privileged)<br />

Via sockets, daemons can also provide source<br />

access across <strong>Unix</strong> hosts.<br />

><br />

<<br />

Socket<br />

Changing UID or GID<br />

! su command<br />

/bin/su [user] creates a new shell <strong>with</strong> UID & GID set to that of user's /etc/passwd record<br />

Always type <strong>the</strong> full path "/bin/su" to avoid trojans, especially when changing to super user.<br />

! newgrp command<br />

newgrp group<br />

changes effective GID of <strong>the</strong> current shell "newgrp" is implemented <strong>with</strong>in <strong>the</strong> shell<br />

File Encryption<br />

$ crypt < exam320 > exam320.encrypted<br />

$ rm exam320<br />

- Crypt is unavailable outside USA (officially)<br />

- Breakable by a public domain toolkit called "crypt Breakers Workbench" !!<br />

- Use data compression for safest encryption.<br />

$ compress exam320 ==> creates file "exam320.Z"<br />

202

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!