headerimage
david-halliday.co.uk

Make /home/

Because pulling users in from the AD doesn't make their /home/ this can cause problems with some things such as ftp. To make the home directories for users use this script (as root)

code

#!/bin/sh 
#all lines starting with "#" are comments

for user in $( wbinfo -u|grep -v [$]|grep [.] );

do #start a loop
# echo "user is: " $user; #output user name
su --command="exit" $user
done # end of script

description

  • "#!/bin/sh" says this is a shell script
  • "wbinfo -u" pulls all the user names out the AD and lists them
  • "grep" is used to filter outputs (in this case the user names)
  • "grep -v [$]" removes any user with a "$" in the name (system users)
  • "grep [.]" lists only names with a "."
  • (all users that I'm interested in using are .
  • su to the user (which makes the /home/ directorie)
  • then give the command "exit" (as that user)
  • which returns back to the super user and continues to run the script.

Give all users audio permission

To give all the users access to use audio I used a similar script:
#!/bin/sh 

for user in $( wbinfo -u|grep -v [$]|grep [.] );
do
addgroup $user audio
done