User:ILebedev: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Ilebedev (talk | contribs)
No edit summary
Ilebedev (talk | contribs)
No edit summary
Line 11: Line 11:
echo "server ntp.eenet.ee" >> /etc/ntp.conf
echo "server ntp.eenet.ee" >> /etc/ntp.conf
service ntp restart  
service ntp restart  
</source>
Quest 5
<source lang=bash>
#!/bin/bash
export LC=ALL_C
getent shadow | grep "2a$" > /dev/null
if [ $? = 0 ]
then
echo "MD5'ga krüpteeritud kasutajad on:"
getent shadow | grep "2a$" > /etc/proov/proov
cut -d"*" -f1 /etc/proov
exit 0
else
echo "MD5'ga ei ole kasutajaid krüpteeritud"
exit 1
fi
</source>
</source>

Revision as of 12:52, 25 February 2014

Quest 1 (5p)

Loo skript, mis paigaldab ntp teenuse ja seab serveriks ntp.eenet.ee

#!/bin/bash
#installeerin ntp teenuse, vastated promptides yes
#Lisan "server ntp.eenet.ee" ntp confi faili lõppu
#teeb teenusele restardi
export LC=ALL_C
sudo apt-get -y install ntp
echo "server ntp.eenet.ee" >> /etc/ntp.conf
service ntp restart

Quest 5

#!/bin/bash
export LC=ALL_C
getent shadow | grep "2a$" > /dev/null
if [ $? = 0 ] 
then
	echo "MD5'ga krüpteeritud kasutajad on:"
	getent shadow | grep "2a$" > /etc/proov/proov
	cut -d"*" -f1 /etc/proov
	exit 0
else
	echo "MD5'ga ei ole kasutajaid krüpteeritud"
	exit 1
fi