cancel
Showing results for 
Search instead for 
Did you mean: 
0x000000ff
Mission Specialist
Mission Specialist
  • 229 Views

Checks in "finish" step for Lab for RH124, Chapter 19, Section 5 are too brittle

There is a check in RH124/c19/s5 performing a `sed` command which blindly assumes that the user just commented out the authentication line, rather than configuring `PasswordAuthentication=no`.  This leads to the grading passing but the script `finish` step failing.

 

---

root@serverb: COMMAND:

if [ -f /etc/ssh/sshd_config.d/50-cloud-init.conf ]; then sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config.d/50-cloud-init.conf && systemctl reload sshd.service; else echo 'File /etc/ssh/sshd_config.d/50-cloud-init.conf not present, moving on...'; fi
2025-08-29 23:06:36,014:ssh-review:INFO:transport.py(1938) Connected (version 2.0, client OpenSSH_9.9)
2025-08-29 23:06:36,082:ssh-review:INFO:transport.py(1938) Authentication (publickey) failed.
2025-08-29 23:06:36,098:ssh-review:INFO:transport.py(1938) Authentication (publickey) failed.
2025-08-29 23:06:36,099:ssh-review:ERROR:step.py(54) Step 'Restoring password authentication on serverb' has failed.
Traceback (most recent call last):
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/labs/common/commands/__init__.py", line 48, in ssh_run_command_step
process = ssh_run_command(command, host, user)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/labs/common/commands/__init__.py", line 177, in ssh_run_command
o = c.run(command, hide=True, warn=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/decorator.py", line 235, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/fabric/connection.py", line 22, in opens
self.open()
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/fabric/connection.py", line 665, in open
result = self.client.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 483, in connect
self._auth(
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 814, in _auth
raise saved_exception
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 751, in _auth
self._transport.auth_publickey(username, key)
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/transport.py", line 1703, in auth_publickey
return self.auth_handler.wait_for_response(my_event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/auth_handler.py", line 263, in wait_for_response
raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.

==== End of logs ====
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 483, in connect
self._auth(
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 814, in _auth
raise saved_exception
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 751, in _auth
self._transport.auth_publickey(username, key)
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/transport.py", line 1703, in auth_publickey
return self.auth_handler.wait_for_response(my_event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/auth_handler.py", line 263, in wait_for_response
raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.
2025-08-29 23:06:35,877:ssh-review:INFO:lablog.py(229) #################### ssh-review ####################
2025-08-29 23:06:35,999:ssh-review:INFO:__init__.py(175)

root@serverb: COMMAND:

if [ -f /etc/ssh/sshd_config.d/50-cloud-init.conf ]; then sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config.d/50-cloud-init.conf && systemctl reload sshd.service; else echo 'File /etc/ssh/sshd_config.d/50-cloud-init.conf not present, moving on...'; fi
2025-08-29 23:06:36,014:ssh-review:INFO:transport.py(1938) Connected (version 2.0, client OpenSSH_9.9)
2025-08-29 23:06:36,082:ssh-review:INFO:transport.py(1938) Authentication (publickey) failed.
2025-08-29 23:06:36,098:ssh-review:INFO:transport.py(1938) Authentication (publickey) failed.
2025-08-29 23:06:36,099:ssh-review:ERROR:step.py(54) Step 'Restoring password authentication on serverb' has failed.
Traceback (most recent call last):
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/labs/common/commands/__init__.py", line 48, in ssh_run_command_step
process = ssh_run_command(command, host, user)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/labs/common/commands/__init__.py", line 177, in ssh_run_command
o = c.run(command, hide=True, warn=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/decorator.py", line 235, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/fabric/connection.py", line 22, in opens
self.open()
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/fabric/connection.py", line 665, in open
result = self.client.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 483, in connect
self._auth(
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 814, in _auth
raise saved_exception
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/client.py", line 751, in _auth
self._transport.auth_publickey(username, key)
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/transport.py", line 1703, in auth_publickey
return self.auth_handler.wait_for_response(my_event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/student/.cache/uv/archive-v0/XYCzndfxs1nhKP3v3Xwif/lib/python3.11/site-packages/paramiko/auth_handler.py", line 263, in wait_for_response
raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.

3 Replies
0x000000ff
Mission Specialist
Mission Specialist
  • 217 Views

Chetan_Tiwary_
Community Manager
Community Manager
  • 159 Views

Thanks , let me take a look and I will report it to the developers for a fix.
0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 135 Views

@0x000000ff just to confirm this is from v10 course right ?

0 Kudos
Join the discussion
You must log in to join this conversation.