source: npl/system/openssh/doinst.sh @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 943 bytes
Line 
1config() {
2  NEW="$1"
3  OLD="`dirname $NEW`/`basename $NEW .new`"
4  # If there's no config file by that name, mv it over:
5  if [ ! -r $OLD ]; then
6    mv $NEW $OLD
7  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
8    rm $NEW
9  fi
10  # Otherwise, we leave the .new copy for the admin to consider...
11}
12
13config etc/ssh/ssh_config.new
14config etc/ssh/sshd_config.new
15
16# If the sshd user/group don't exist, add them:
17if grep "^sshd:x:" etc/passwd 1> /dev/null 2> /dev/null ; then
18  true
19else
20  echo "sshd:x:33:33:sshd:/:" >> etc/passwd
21fi
22if grep "^sshd::" etc/group 1> /dev/null 2> /dev/null ; then
23  true
24else
25  echo "sshd::33:sshd" >> etc/group
26fi
27if grep "^sshd:" etc/shadow 1> /dev/null 2> /dev/null ; then
28  true
29else
30  echo "sshd:*:9797:0:::::" >> etc/shadow
31fi
32
33# Add a btmp file to store login failure if one doesn't exist:
34if [ ! -r var/log/btmp ]; then
35  ( cd var/log ; umask 077 ; touch btmp )
36fi
37
Note: See TracBrowser for help on using the repository browser.