Modify User Accounts 2.10 Adjust the settings for user joe's password such that he can * change his password after at least a week, and * must change it after at most two weeks. * There should be a warning two days before the two weeks are up. * Check the settings afterwards. userdel - Leftovers What stuff might be left over after removing a userid? List at least 6 things. What problems might occur when removing a userid? Move user5 HOME to a different disk. Do it the easy way, using 1 command. Login as the user to validate you didn't make any mistakes. Move user4 HOME to a different disk. Do it the hard way, manually. Login as the user to validate you didn't make any mistakes. Validate the Passwd and Group databases. Fix any issues. User Create/Manage Exercises - 3d Create a script that: * new group, "webmasters", * Add user1, 4, 5, as non-primary group members for webmasters __ Create another script to delete all the accounts and groups you've created __ Test both scripts, a few times. __ Validate the group and passwd databases are consistent. Fix the script(s) until everything is consistent. Exercises User Create/Manage - 3e Change a userid for user1 to 20001 __ Handle all issues that might arise. Change the primary groupid for webmasters to 1999. Handle all issues that might arise. Exercise - User Account Mgnt - 4 2.11 Create a user called test . Change to the test account and create a few files using TOUCH , including a few in a different directory than the home directory (say, /tmp ). Change back to root and change test's UID. What do you see when listing user test's files? Exercise - User Account Mgnt - 5 2.12 Create users called test1 w/ GUI and test2 by USERADD command, and test3 w/ VIPW . Look at the configuration files. Can you work without problems using any of these three accounts? Create a file using each of the new accounts. Exercise - User Delete - 6 2.13 Delete user test2's account and ensure that there are no files left on the system that belong to that user. deluser .... or find .... Exercise - Userid modification - 7 2.14 Change user test1's UID. What else do you need to do? find .... # change all files owned by the old userid _May_ want to change the groupid too _opt_ Shadow file? Nope. uid isn't used there. Exercise - Userid New HOME - 8 2.15 Change user test1's home directory from /home/test1 to /home/user/test1 . Exercises - Groups - 10 2.17 Can you create a directory that all members of a group can access? Worded differently ... make a shared directory that all the members if the webmasters group can edit files inside. Ensure that new files automatically have the webmasters group and that all members can edit those files and any directories and files below it. If you need to, work through a file and directory permissions tutorial to refresh this knowledge. Do NOT use 777 permissions. Verify that each userid can edit files, delete files, etc. sudoedit - not in the book Safer way to edit system files. 1. EDITOR env is used __ 2. Copies the files __ 3. Runs the editor as normal userid __ 4. At close, saves and copies files back __ Retains original owner/group/permissions __ Prevents sudoers from shelling out, gaining root __ Doesn't lock the files _Care on multi-admin systems_ Command Summary - adduser (deb)/ useradd / userdel / _deluser_ / usermod - _addgroup_ / groupadd / _delgroup_ / groupdel / groupmod - gpasswd / newgrp - getent [ passwd | group | hosts ] - chage / chsh / chfn - id / groups - vipw / vigr / sudoedit - w / who / last passwd + chage adduser + user[add|mod|del] / group[add|mod|del] / gpasswd End of Chpt 2 - User