Geek fatigue

One of the most tiresome aspects of sysadmin work are repeat tasks. It has been said that sysadmins are lazy by nature. I would have to agree. A good example is having to add or delete users from a Linux box. Adding one user at a time really isn't an issue if you only have one or two; however if you have several accounts to add it can become quite tedious.

I discovered the script called newusers which allows one to add several users at once, you simply need to setup a flat text file with a few parameters shown below:

pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell

Actually, you can provide all or just some of the parameters above. I chose to only provide a username, password, home directory, and shell. So you have the following ->

username:passwd::::homedir:$SHELL  (Note the ::: represent blank field parameters.)

I simply stored all the users in a file

username1:passwd::::/home/username1:/bin/bash

username2:passwd::::/home/username2:/bin/bash

Another great script is the 'mkpasswd' as it creates a 9 random character passwd. Obviously, these scripts used in conjunction are a wonderful tools. They are particularly useful when setting up multiple user accounts on a new server. 

As I have mentioned previously, when I setup new user accounts on a servers which I build for clients, I setup samba username and passwds.

In the process of setting up these samba accounts, I have encountered problems with the ubiquitous 'smbpasswd -a username' which basically adds new users to the samba database.

However, there are often times when 'smbpasswd' will not work as expected.  There are tools that mitigate this problem.  tdsam and pdbedit will also repair or create samba users for the samba database. 

I will share some additional scripting measures for creating samba user accounts in a forthcoming blog entry






  • Wonders of setgid
  • Importance of Loopback Device
  • klogctl: Operation not permitted
  • sshfs / FUSE and gmailfs
  • Monthly Archives

    Pages

    OpenID accepted here Learn more about OpenID
    Powered by Movable Type 4.25

    About this Entry

    This page contains a single entry by AG published on January 1, 2013 11:38 AM.

    Wonders of setgid was the previous entry in this blog.

    RMS Sighting is the next entry in this blog.

    Find recent content on the main index or look in the archives to find all content.