Skip to content

Commit

Permalink
Merge branch 'master' of github.com:beagleboard/beaglebone-getting-st…
Browse files Browse the repository at this point in the history
…arted
  • Loading branch information
Jason Kridner committed Dec 13, 2013
2 parents b501971 + 29c0099 commit 641b3ff
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/debian-resecure.sh
@@ -0,0 +1,30 @@
#!/bin/sh

if ! id | grep -q root; then
echo "must be run as root"
exit
fi

echo "Reseting root password to [root]..."

#it was blanked out via:
#root_password=$(cat /etc/shadow | grep root | awk -F ':' '{print $2}')
#sed -i -e 's:'$root_password'::g' /etc/shadow

passwd <<-_EOF_
root
root
_EOF_

echo "ssh: resecuring, password now required..."

#it was opened up via:
#sed -i -e 's:PermitEmptyPasswords no:PermitEmptyPasswords yes:g' /etc/ssh/sshd_config
#sed -i -e 's:UsePAM yes:UsePAM no:g' /etc/ssh/sshd_config

sed -i -e 's:PermitEmptyPasswords yes:PermitEmptyPasswords no:g' /etc/ssh/sshd_config
sed -i -e 's:UsePAM no:UsePAM yes:g' /etc/ssh/sshd_config
/etc/init.d/ssh restart

echo "Complete..."

0 comments on commit 641b3ff

Please sign in to comment.