Commit c6d78efb authored by Jeroen F.J. Laros's avatar Jeroen F.J. Laros

Added permissions lecture (not used).

parent 0e03b725
../.submodules/presentation/Makefile
\ No newline at end of file
../.submodules/presentation/beamerthemelumc.sty
\ No newline at end of file
#FIG 3.2 Produced by xfig version 3.2.5b
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
6 507 270 6963 5546
3 3 0 1 7 7 50 -1 -1 0.000 0 0 0 4
1395 585 3555 1800 1710 3420 585 1305
-1.000 -1.000 -1.000 -1.000
3 3 0 1 7 7 50 -1 -1 0.000 0 0 0 4
4680 810 6525 765 6435 2790 4410 2205
-1.000 -1.000 -1.000 -1.000
3 3 0 1 7 7 50 -1 -1 0.000 0 0 0 4
3150 3735 5130 4005 3645 5445 2610 4410
-1.000 -1.000 -1.000 -1.000
4 0 7 50 -1 0 12 0.0000 4 135 465 2385 765 audio\001
4 0 7 50 -1 0 12 0.0000 4 135 465 4635 585 video\001
4 0 7 50 -1 0 12 0.0000 4 135 345 4905 4725 adm\001
4 0 7 50 -1 0 12 0.0000 4 135 285 990 1575 vill\001
4 0 7 50 -1 0 12 0.0000 4 180 450 1800 2475 jlaros\001
4 0 7 50 -1 0 12 0.0000 4 135 285 4905 1125 vill\001
4 0 7 50 -1 0 12 0.0000 4 180 450 5625 2160 jlaros\001
4 0 7 50 -1 0 12 0.0000 4 135 285 3510 4590 vill\001
-6
../.submodules/presentation/logos
\ No newline at end of file
\documentclass[slidestop]{beamer}
\title{Ownership and Permissions}
\providecommand{\myConference}{Scripting course}
\providecommand{\myDate}{Monday, October 21, 2013}
\author{Jeroen F. J. Laros}
\providecommand{\myGroup}{Leiden Genome Technology Center}
\providecommand{\myDepartment}{Department of Human Genetics}
\providecommand{\myCenter}{Center for Human and Clinical Genetics}
\providecommand{\lastCenterLogo}{
\raisebox{-0.1cm}{
\includegraphics[height=1cm]{logos/lgtc_logo}
%\includegraphics[height=0.7cm]{ngi_logo}
}
}
\providecommand{\lastRightLogo}{
%\includegraphics[height=0.7cm]{nbic_logo}
%\includegraphics[height=0.8cm]{nwo_logo_en}
%\hspace{1.5cm}\includegraphics[height=0.7cm]{gen2phen_logo}
}
\usetheme{lumc}
\begin{document}
% This disables the \pause command, handy in the editing phase.
%\renewcommand{\pause}{}
% Make the title page.
\bodytemplate
% First page of the presentation.
\section{Introduction}
\begin{frame}[fragile]
\frametitle{Ownership: When do we have to deal with it?}
Permission denied.
\begin{lstlisting}[language=none, caption=.]
$ cat /var/log/syslog
cat: /var/log/syslog: Permission denied
\end{lstlisting}
\bigskip
\begin{lstlisting}[language=none, caption=.]
$ whoami
jlaros
\end{lstlisting}
\bigskip
Apparently, the user \bt{jlaros} is not allowed to read \bt{syslog}.
\end{frame}
\section{Users and groups}
\begin{frame}
\frametitle{Ownership: Users and groups}
\begin{itemize}
\item Linux uses \emph{users} and \emph{groups} for access control.
\item Files and directories are owned by one \emph{user}.
\item A user can be part of a \emph{group}.
\end{itemize}
\bigskip
By using \emph{group permissions} on files and putting users in a group,
access to files and directories can be controlled.
\end{frame}
\begin{frame}
\frametitle{Ownership: Users and groups}
\begin{center}
\scalebox{0.6}{
\input{groups.pstex_t}
}
\end{center}
\begin{table}[]
\begin{center}
\begin{tabular}{l|l}
group & users\\
\hline
audio & vill, jlaros\\
video & vill, jlaros\\
adm & vill
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{frame}
\begin{frame}[fragile]
\frametitle{Ownership: Users and groups}
\begin{lstlisting}[language=none, caption=.]
$ groups jlaros
jlaros : jlaros audio video
\end{lstlisting}
\bigskip
\begin{lstlisting}[language=none, caption=.]
$ groups vill
vill : vill audio video adm
\end{lstlisting}
\end{frame}
\section{File permissions}
\begin{frame}[fragile]
\frametitle{Ownership: File permissions}
\begin{lstlisting}[language=none, caption=.]
$ ls -al
\end{lstlisting}
\begin{table}[]
\begin{center}
\begin{tabular}{l|l}
option & meaning\\
\hline
-a & show all files (including hidden files)\\
-l & long listing format\\
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
$
\raise.2ex\hbox{$\stackrel{\stackrel{\mathbf{directory}}{\downarrow}}{\rm d}$}
\!\!\!\!\!\!\!\!\!
\underbrace{\rm{rwx}}_{\stackrel{\mathbf{owner}}{}}\!\!
\underbrace{\rm{rwx}}_{\raise-2ex\hbox{$\stackrel{\stackrel{\mathbf{group}}{}}{}$}}\!\!
\underbrace{\rm{rwx}}_{\stackrel{\mathbf{other}}{}}
$
\begin{table}[]
\begin{center}
\begin{tabular}{l|l}
abbreviation & meaning\\
\hline
d & directory\\
r & read permission\\
w & write permission\\
x & execute permission
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{frame}
\begin{frame}[fragile]
\frametitle{Ownership: File permissions}
\begin{lstlisting}[language=none, caption=.]
$ ls -al /var/log/syslog
\end{lstlisting}
\bigskip
$
\raise.2ex\hbox{$\stackrel{\stackrel{\mathbf{directory}}{\downarrow}}{\rm\mbox{-}}$}
\!\!\!\!\!\!\!\!\!
\underbrace{
\underbrace{\rm{rw\:\mbox{-}\:}}_{\stackrel{\mathbf{owner}}{}}\!\!
\underbrace{\rm{r\:\mbox{-}\:\mbox{-}\:}}_{\raise-2ex\hbox{$\stackrel{\stackrel{\mathbf{group}}{}}{}$}}\!\!
\underbrace{\rm{\mbox{-}\:\mbox{-}\:\mbox{-}}}_{\stackrel{\mathbf{other}}{}}
}_{\rm{permissions}}
\!\!\!\!\!\!
\raise.2ex\hbox{$\stackrel{\stackrel{\mathbf{link\,count}}{\downarrow}}{\rm 1}$}
\!\!\!\!\!\!\!
\underbrace{
\underbrace{\rm{root}}_{\stackrel{\mathbf{owner}}{}}\,\,\,
\underbrace{\rm{adm}}_{\stackrel{\mathbf{group}}{}}\,\,\,
}_{\rm{ownership}}
\underbrace{\rm{96257}}_{\stackrel{\mathbf{size}}{}}\,\,\,
\underbrace{\rm{Feb\;18\;15\!:\!\!12}}_{\stackrel{\mathbf{date}}{}}\,\,\,
\underbrace{\rm{/var/log/syslog}}_{\stackrel{\mathbf{name}}{}}
$
\bigskip
\begin{table}[]
\begin{center}
\begin{tabular}{l|l|l}
user & status & permissions\\
\hline
root & owner & \bt{rw-}\\
vill & member of the ``adm'' group & \bt{r--}\\
jlaros & normal user & \bt{---}
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{frame}
\begin{frame}[fragile]
\frametitle{Ownership: File permissions}
\begin{lstlisting}[language=none, caption=.]
$ ls -ald /var/log/sysstat
\end{lstlisting}
\bigskip
$
\raise.2ex\hbox{$\stackrel{\stackrel{\mathbf{directory}}{\downarrow}}{\rm d}$}
\!\!\!\!\!\!\!\!\!
\underbrace{
\underbrace{\rm{rwx}}_{\stackrel{\mathbf{owner}}{}}\!\!
\underbrace{\rm{r\:\mbox{-}\:x}}_{\raise-2ex\hbox{$\stackrel{\stackrel{\mathbf{group}}{}}{}$}}\!\!
\underbrace{\rm{\:\mbox{-}\:\mbox{-}\:\mbox{-}}}_{\stackrel{\mathbf{other}}{}}
}_{\rm{permissions}}
\!\!\!\!\!\!
\raise.2ex\hbox{$\stackrel{\stackrel{\mathbf{link\,count}}{\downarrow}}{\rm 2}$}
\!\!\!\!\!\!\!
\underbrace{
\underbrace{\rm{root}}_{\stackrel{\mathbf{owner}}{}}\,\,\,
\underbrace{\rm{adm}}_{\stackrel{\mathbf{group}}{}}\,\,\,
}_{\rm{ownership}}
\underbrace{\rm{4096}}_{\stackrel{\mathbf{size}}{}}\,\,\,
\underbrace{\rm{Feb\;18\;15\!:\!\!12}}_{\stackrel{\mathbf{date}}{}}\,\,\,
\underbrace{\rm{/var/log/sysstat}}_{\stackrel{\mathbf{name}}{}}
$
\bigskip
\begin{table}[]
\begin{center}
\begin{tabular}{l|l|l}
user & status & permissions\\
\hline
root & owner & \bt{rwx}\\
vill & member of the ``adm'' group & \bt{r-x}\\
jlaros & normal user & \bt{---}
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{frame}
\begin{frame}[fragile]
\frametitle{Ownership: File permissions}
The execute bit for files.
\begin{lstlisting}[language=none, caption=.]
$ ls -al
drwx------ 2 jlaros jlaros 1024 Mar 24 13:50 .
drwxrwxrwt 27 root root 10240 Mar 24 13:50 ..
-rwx------ 1 jlaros jlaros 29 Mar 24 13:50 hello
-rw------- 1 jlaros jlaros 20 Mar 24 13:50 text
\end{lstlisting}
\begin{lstlisting}[language=none, caption=.]
$ ./hello
Hello world!
\end{lstlisting}
\begin{lstlisting}[language=none, caption=.]
$ ./text
bash: ./text: Permission denied
\end{lstlisting}
\begin{lstlisting}[language=none, caption=.]
$ cat text
This is a textfile.
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Ownership: File permissions}
The execute bit for directories.
\begin{lstlisting}[language=none, caption=.]
$ ls -al
drwx------ 2 jlaros jlaros 1024 Mar 24 13:50 .
drwxrwxrwt 27 root root 10240 Mar 24 13:50 ..
-rwx------ 1 jlaros jlaros 29 Mar 24 13:50 hello
-rw------- 1 jlaros jlaros 20 Mar 24 13:50 text
\end{lstlisting}
\begin{lstlisting}[language=none, caption=.]
$ chmod -r .
$ ls -al
ls: cannot open directory .: Permission denied
\end{lstlisting}
\begin{lstlisting}[language=none, caption=.]
$ ./hello
Hello world!
\end{lstlisting}
\begin{lstlisting}[language=none, caption=.]
$ chmod -x .
$ ./hello
bash: ./hello: Permission denied
\end{lstlisting}
\end{frame}
\begin{frame}
\frametitle{Ownership: File permissions}
Summary of valid combinations.
\bigskip
\begin{table}[]
\begin{center}
\begin{tabular}{l|l|l}
type & execute & result\\
\hline
directory & \bt{+x +r} & Usable and readable.\\
directory & \bt{+x -r} & Usable but not readable.\\
file & \bt{+x +r} & Executable and readable.\\
file & \bt{-x +r} & Readable.\\
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{frame}
\section{Questions?}
\lastpagetemplate
\begin{frame}
\begin{center}
Acknowledgements:
\bigskip
\bigskip
\end{center}
\end{frame}
\end{document}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment