This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
script to change home path in /etc/passwd
- From: sferriol <sylvain dot ferriol at imag dot fr>
- To: cygwin <cygwin at cygwin dot com>
- Date: Mon, 19 May 2003 12:13:46 +0200
- Subject: script to change home path in /etc/passwd
hello
i see that ssh read /etc/passwd for searching keys and other files.
i've made a little script to change the home path in /etc/passwd
it's not perfect and may be need improvements.
#!/bin/bash
OS=`uname -o`
# in cygwin case
if [ ${OS} == "Cygwin" ]; then
/bin/cp -p /etc/passwd /etc/passwd-bak-tmp &&
/bin/grep -v ${USERNAME} /etc/passwd-bak-tmp > /etc/passwd &&
mkpasswd -l -u ${USERNAME} -p ${HOME} > /etc/passwd-bak-tmp &&
/bin/sed -e "s/\/${USERNAME}:/:/" /etc/passwd-bak-tmp >> /etc/passwd &&
/bin/rm -f /etc/passwd-bak-tmp
fi
Sylvain
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/