You are on page 1of 5

Week 2: Users and Groups, Managing

Resources
CIS 341 AB1

Carl A. Janzen
Fall 2016

Contents
1 Introduction 2
1.1 Review from last class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Managing Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Wrap-Up 5
2.1 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1 Review from last class Review This is only an introduction to these topics. and search for pattern matches • Get help: accessing man and info pages. fifos. display a directory tree structure. or termrec • Checking file contents and paging: use tail. Throughout the course we will delve into more details in all of these areas. find files in subdirectories or ‘locatedb‘. • Find your way around: list directories. less. and record your session using script. print current directory. the tee command. create and delete files and directories. redirect standard error and standard output. head. writing. and create links including symbolic links • Permissions: modify and interpret permissions to permit or prevent reading. git version control for software projects. or execution/listing of files/directories and use the setgid bit and the ‘chgrp‘ command to enable collaboration in a shared directory • Remote access: generate a public/private keypair and use it to authenticate to a remote system Remote file management scp use ssh to copy files rsync use ssh (if necessary) to copy only the differences between two locations (optionally deleting) sftp/lftp expose ftp/scp functionality in a convenient commandline ftp client interface. 2/5 . and wc to view or summarize all or part of a text file • File management: change directories. find related commands using apropos. ttyrec. show file contents. access package supplied documents in /usr/share/doc as well as online resources such as tldp • Type less: use history and tab completion features to reduce your typing load • Edit files properly: begin to use the most common vi commands to edit text files • I/O redirection: use pipes. 1 Introduction 1.

except they are all preceded by Ctrl+B instead of Ctrl+A 1.bashrc runs every time bash starts a shell / subshell .profile runs only on interactive login shells (see also . user can belong to multiple groups 1.2 Accounts 3/5 .PS2 set custom prompts Configuration Files dotfiles it is customary for config files and directories to start with a dot dotbot (github project) one of numerous utilities avaialable for quickly configuring a new account 1. Very similar key bindings. and shadow file has more restricted access to password hash groups Stored in /etc/group. Allows you to have multiple windows.2 Accounts Become root sudo sanitize environment. including split screen tmux modern re-write of screen. and run single command as root user su switch user (by default.bash_profile) umask sets default file creation mask PS1. to become root. but can also be used to become other users) Manage users and groups users Stored in /etc/passwd has account info.3 Configuration Setting defaults /etc/skel Default settings for all users . available on almost any system. Windows screen venerable console window manager.

depending on your permissions • top shows a live updated process list (see also htop) • nohup prevents SIGHUP (hangup) from being sent to a background process when you exit the shell • renice lets you set the priority of a process.4 Managing Resources processes • kill will let you send one of several signals (ie. SIGUSR1. SIGTERM) to any job by process id • killall will allow you to do the same by name • jobs are placed in the background when followed by a & symbol • Ctrl+Z will suspend the current job • fg will bring jobs back from the background • jobs will list all running jobs in the current shell • ps can list more process details. 1. Useful for listing your hardware (see also lshw) /proc/cpuinfo cpu description /proc/meminfo ram description vmstat summary of allocated memory resources free shows available ram /dev device filesystem network netstat -pant list connections ping verify connectivity traceroute verify hops to destination dig get detailed information about an address tcpdump inspect network traffic (see also ettercap/wireshark) route -n show active routes [ip] show/manipulate routes. etc 1.4 Managing Resources 4/5 . addresses. SIGHUP. -20 is least nice (highest priority) and 20 is most nice (lowest priority) hardware lspci -vv list pci bus details.

free. route • scheduled jobs: crontab/permission for. nice • hardware: lspci. batch run a job when system load drops below 0. tcpdump. delete at jobs.bashrc. /proc.1 Review • Remote file management: scp. .8 (see load) 2 Wrap-Up 2. sftp/lftp • Windows: screen.2 Homework Homework • Assignment 1 posted 5/5 . /dev • network: netstat. atrm list. traceroute. {add|del}group. git. atq 2. user{add|mod|del} • Setting defaults: /etc/skel. gps. ping. vmstat. sudo • Manage users and groups: id. at. scheduled jobs crontab /etc/cron. top. rsync. jobs. dig.d contains config files that allow you to allow/deny use of crontab (sched- uled recurring jobs) at run a job at a specific time atq.profile • Configuration Files: dotfiles • processes: kill. tmux • Become root: su. cpuinfo. . meminfo. killall. {add|mod|del}user. atrm.