[ILUG] Changing a users home directory with passwd

Gavin McCullagh ilug_gmc at fiachra.ucd.ie
Mon May 20 23:15:40 IST 2002


On Mon, 20 May 2002, Mark Finlay wrote:

> I want to be able to change a users home directory in a shell script
> (ie. without manually editing /etc/passwd).

chsh -s /bin/bash colin

will change colin's shell to bash.

> 
> man passwd says that passwd -h <username> should do it but when i do
> that it just says "Password changed"
> 
> Short of that is there any way to automagically change /home/guest to
> /local/guest in the /etc/passwd file via bash a perl script.

probably using ed/perl/sed/awk/...?

Gavin





More information about the ILUG mailing list