Skip to content

Commit 641b3ff

Browse files
author
Jason Kridner
committed
Merge branch 'master' of github.com:beagleboard/beaglebone-getting-started
2 parents b501971 + 29c0099 commit 641b3ff

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/debian-resecure.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
if ! id | grep -q root; then
4+
echo "must be run as root"
5+
exit
6+
fi
7+
8+
echo "Reseting root password to [root]..."
9+
10+
#it was blanked out via:
11+
#root_password=$(cat /etc/shadow | grep root | awk -F ':' '{print $2}')
12+
#sed -i -e 's:'$root_password'::g' /etc/shadow
13+
14+
passwd <<-_EOF_
15+
root
16+
root
17+
_EOF_
18+
19+
echo "ssh: resecuring, password now required..."
20+
21+
#it was opened up via:
22+
#sed -i -e 's:PermitEmptyPasswords no:PermitEmptyPasswords yes:g' /etc/ssh/sshd_config
23+
#sed -i -e 's:UsePAM yes:UsePAM no:g' /etc/ssh/sshd_config
24+
25+
sed -i -e 's:PermitEmptyPasswords yes:PermitEmptyPasswords no:g' /etc/ssh/sshd_config
26+
sed -i -e 's:UsePAM no:UsePAM yes:g' /etc/ssh/sshd_config
27+
/etc/init.d/ssh restart
28+
29+
echo "Complete..."
30+

0 commit comments

Comments
 (0)