How use API to change shell

3 posts / 0 new
Last post
#1 Wed, 06/26/2013 - 12:31
jimdunn

How use API to change shell

I know about the "chsh" command, but I have updated my "Custom Shells" and would like to run Virtualmin API scripts to change all of the domain owners to a new shell.

Is this possible?

Wed, 06/26/2013 - 13:14
jimdunn

Oops, I should remember to thoroughly read the docs... I am able to use a shell script to mass change the default shell for users, e.g.:

# chsh -s /usr/bin/scponly domainowner01
# chsh -s /usr/bin/scponly domainowner02
...
# chsh -s /usr/bin/scponly domainowner89
# chsh -s /usr/bin/scponly domainowner90

Thx!!!

Wed, 06/26/2013 - 14:04
andreychek

Howdy,

You could use the Virtualmin command line to generate a list of Virtual Server owners... you could then loop over that list of users, and use that chsh command.

A command such as this will show you all the Virtual Server owners:

virtualmin list-domains --user-only | uniq

Topic locked