summaryrefslogtreecommitdiffstats
path: root/freenx
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2010-06-04 13:54:37 +0000
committer Eric Hameleers <alien@slackware.com>2010-06-04 13:54:37 +0000
commit7da075d500179c5a7c09ccd3ac2292cedd8d5ab8 (patch)
treebd545a878ac25b152e26a1784ce013052aa4046d /freenx
parent9dfe356d13a20ec255756fd497ccb7597ffcdb48 (diff)
downloadasb-7da075d500179c5a7c09ccd3ac2292cedd8d5ab8.tar.gz
asb-7da075d500179c5a7c09ccd3ac2292cedd8d5ab8.tar.xz
The password can not be empty nowadays, or you can not login.
Diffstat (limited to 'freenx')
-rwxr-xr-xfreenx/build/doinst.sh.freenx12
1 files changed, 12 insertions, 0 deletions
diff --git a/freenx/build/doinst.sh.freenx b/freenx/build/doinst.sh.freenx
index 1f6991be..6f6ec1b4 100755
--- a/freenx/build/doinst.sh.freenx
+++ b/freenx/build/doinst.sh.freenx
@@ -49,7 +49,19 @@ if [ ! -e \${NX_ETC_DIR}/users.id_dsa ]; then
fi
if ! getent passwd | egrep -q "^nx:"; then
+ # Dream up a random password:
+ RANDPW=$(date ': date +%s | md5sum | cut -d' ' -f1)
+ # If we have perl, we make a nice hash for the random password, else we just
+ # write the md5sum into the password file.. after all, the password for the
+ # account will never be used (ssh key only):
+ if which perl >/dev/null 2>&1 ; then
+ CRYPTPW=$(perl -e 'use strict; print crypt("$RANDPW","\$1\$$RANDPW")."\n";')
+ else
+ CRYPTPW="$RANDPW"
+ fi
+ # Now, create the 'nx' account:
useradd -m -d \${NX_HOME_DIR} -s /usr/bin/nxserver nx
+ usermod -p "$CRYPTPW" nx 1>/dev/null
passwd -u nx 1>/dev/null
mkdir -p \${NX_HOME_DIR}/.ssh
chmod 700 \${NX_HOME_DIR}/.ssh