We will be using loghost as a RADIUS service host and implementing use of that service for testuser to login using ssh on loghost. So you will need to be on loghost to do the activities for this lab. webhost and nmshost do not need to be running for this lab.
ssh loghost
sudo apt update
sudo apt install freeradius
sudo netstat -tulpn
Freeradius configuration files are kept under /etc/freeradius
.
radiusd.conf
to log auth messages to syslog by changing no
to yes
on the auth =
line.clients.conf
file.
sudo sed -i --follow-symlinks -e 's/auth = no/auth = yes/' /etc/freeradius/3.0/radiusd.conf
sudo grep '^ secret = ' /etc/freeradius/3.0/clients.conf
grep -q testuser /etc/freeradius/3.0/users || sudo sed -i --follow-symlinks '1i#User for lab 8\ntestuser Cleartext-Password := "radiuspassword"\n' /etc/freeradius/3.0/users
sudo systemctl enable freeradius
sudo systemctl restart freeradius
radtest
to verify you can get a successful authentication of your test user, and also do one with an incorrect password
radtest testuser radiuspassword localhost 1 testing123
radtest testuser badpass localhost 1 testing123
/var/log/freeradius/radius.log
to see what got recorded
tail /var/log/freeradius/radius.log
radtest
for your test user with an incorrect secret
radtest testuser password localhost 1 badsecret
tail /var/log/freeradius/radius.log
/var/log/freeradius/radius.log
and /var/log/auth.log
files?sudo adduser testuser
sudo adduser testuser sudo
sudo apt install libpam-radius-auth
sudo sed -i --follow-symlinks '/127.0.0.1/s/secret/testing123/' /etc/pam_radius_auth.conf
sudo sed -i --follow-symlinks '1i# Adding radius auth for lab 8\nauth sufficient pam_radius_auth.so\n' /etc/pam.d/sshd
/var/log/freeradius/radius.log
and /var/log/auth.log
files?/var/log/freeradius/radius.log
and /var/log/auth.log
files?sudo sed -i --follow-symlinks 's/^@include common-auth/#@include common-auth/' /etc/pam.d/sshd
/var/log/freeradius/radius.log
and /var/log/auth.log
files?Screenshot the following commands and their output run on loghost:
radtest testuser radiuspassword localhost 1 testing123
radtest testuser badpass localhost 1 testing123
radtest testuser password localhost 1 badsecret
ssh testuser@loghost
tail -n 20 /var/log/freeradius/radius.log /var/log/auth.log
Submit your screenshots on blackboard.