Development in php, python, perl, C, C++, java, assembly MySQL DBE, MySQL DBA, LPIC-1, LPIC-2, Zend PHP5, Zend PHP5.3, Certified Ubuntu professional, and a dive instructor. 2 woensdag 25 april 12
Development in php, python, perl, C, C++, java, assembly MySQL DBE, MySQL DBA, LPIC-1, LPIC-2, Zend PHP5, Zend PHP5.3, Certified Ubuntu professional, and a dive instructor. Blog: www.adayinthelifeof.nl Twitter: @jaytaph 2 woensdag 25 april 12
Development in php, python, perl, C, C++, java, assembly MySQL DBE, MySQL DBA, LPIC-1, LPIC-2, Zend PHP5, Zend PHP5.3, Certified Ubuntu professional, and a dive instructor. Blog: www.adayinthelifeof.nl Twitter: @jaytaph “Jack-of-all-trades, master of none” 2 woensdag 25 april 12
cool • Vage commando’s en veel data op het scherm is l33t: # cat access_log | cut -f 1 -d\ | sort | uniq -c | sort -nr # find . -type f -exec grep -i -H “pfz” {} \; • But first things first... 16 woensdag 25 april 12
naar de /tmp • Ga naar je eigen (home)directory • Ga naar de directory /var/lib/samba/ printers • Ga naar de directory /var/lib/samba 22 woensdag 25 april 12
een groep (group). • Elk bestand heeft permissies voor owner, group en others. • 3 permissies: • r (4) - mag lezen • w (2) - mag schrijven 23 woensdag 25 april 12
een groep (group). • Elk bestand heeft permissies voor owner, group en others. • 3 permissies: • r (4) - mag lezen • w (2) - mag schrijven • x (1) - mag uitvoeren (of naar die directory gaan) 23 woensdag 25 april 12
een groep (group). • Elk bestand heeft permissies voor owner, group en others. • 3 permissies: • r (4) - mag lezen • w (2) - mag schrijven • x (1) - mag uitvoeren (of naar die directory gaan) 23 woensdag 25 april 12
een groep (group). • Elk bestand heeft permissies voor owner, group en others. • 3 permissies: • r (4) - mag lezen • w (2) - mag schrijven • x (1) - mag uitvoeren (of naar die directory gaan) • Nog anderen: sticky bit, SUID, SGID 23 woensdag 25 april 12
uit de directory /bin • “.bashrc” uit de directory /home/pfz • “vmlinuz” uit de root directory • “ibdata1” uit de /var/lib/mysql directory 25 woensdag 25 april 12
uit de directory /bin • “.bashrc” uit de directory /home/pfz • “vmlinuz” uit de root directory • “ibdata1” uit de /var/lib/mysql directory 25 woensdag 25 april 12
uit de directory /bin • “.bashrc” uit de directory /home/pfz • “vmlinuz” uit de root directory • “ibdata1” uit de /var/lib/mysql directory 25 woensdag 25 april 12
- create a new user or update default new user information Synopsis useradd [options] LOGIN useradd -D useradd -D [options] Description When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line and the default values from the system. Depending on command line options, the useradd command will update system files and may also create the new user's home directory and copy initial files. The version provided with Red Hat Linux will create a group for each user added to the system by default. Options The options which apply to the useradd command are: -c, --comment COMMENT Any text string. It is generally a short description of the login, and is currently used as the field for the user's full name. -b, --base-dir BASE_DIR The default base directory for the system if -d dir is not specified. BASE_DIR is concatenated with the account name to define the home directory. If the -m option is not used, BASE_DIR must exist. -d, --home HOME_DIR The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that as the login directory name. The directory HOME_DIR does not have to exist but will not be created if it is missing. -e, --expiredate EXPIRE_DATE The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD. -f, --inactive INACTIVE The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of -1 disables the feature. The default value is -1. -g, --gid GROUP 30 woensdag 25 april 12
systeem? • Creer een gebruiker (je-eigen-naam) • Creer een 2e gebruiker (anderenaam). Zorg dat deze gebruiker alleen maar via ftp op je systeem kan, en alleen in directory /var/www kan uploaden. • (hints: gebruiker moet in de groep www-data, als shell moet hij /sbin/ nologin hebben, en de /var/www directory moet andere permissies krijgen) 31 woensdag 25 april 12