Skip to content

Request: ShellDriver: put_ssh_key would benefit from a destination file attribute #1626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pmelange opened this issue Mar 5, 2025 · 2 comments · May be fixed by #1631
Open

Request: ShellDriver: put_ssh_key would benefit from a destination file attribute #1626

pmelange opened this issue Mar 5, 2025 · 2 comments · May be fixed by #1631

Comments

@pmelange
Copy link
Contributor

pmelange commented Mar 5, 2025

The call put_ssh_key assumes a destination file of ~/.ssh/authroized_keys on the DUT. Yet when an embedded system (such as OpenWrt) uses dropbear as the ssh server daemon, the authorized_keys file may be located elsewhere. For example, with OpenWrt, the authorized_keys file is found in /etc/dropbear/authorized_keys

An optional attribute such as dest_authorized_keys with a default value set to ~/.ssh/authorized_keys which can be overridden with an alternative filename for the DUT would be a practical solution.

@pmelange
Copy link
Contributor Author

pmelange commented Mar 5, 2025

Workaround:
Run the shell command
cp ~/.ssh/authorized_keys /etc/dropbear
which can be added to a strategy

pmelange added a commit to pmelange/labgrid that referenced this issue Mar 10, 2025
Add an addition optional arg "dest_authorized_keys" with the default
value of ```~/.ssh/authorized_keys```,

And example where this might be used is when an embedded system uses
dropbear as it's ssh server daemon.  In such a case, the authorized_keys
file is ```/etc/dropbear/authorized_keys```

Additionally, the ```put_key_file``` takes an optional
```dest_authorized_keys``` function parameter which defaults to the above arg.

Fixes: #labgrid-project#1626

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
pmelange added a commit to pmelange/labgrid that referenced this issue Mar 10, 2025
Add an addition optional arg "dest_authorized_keys" with the default
value of ```~/.ssh/authorized_keys```,

An example where this might be used is when an embedded system uses
dropbear as it's ssh server daemon.  In such a case, the authorized_keys
file is ```/etc/dropbear/authorized_keys```

Additionally, the ```put_key_file``` takes an optional
```dest_authorized_keys``` function parameter which defaults to the above arg.

Fixes: #labgrid-project#1626

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
@pmelange pmelange linked a pull request Mar 10, 2025 that will close this issue
3 tasks
@pmelange
Copy link
Contributor Author

@jluebbe I have implemented the changes. Perhaps you would be willing to take a look at PR #1631

pmelange added a commit to pmelange/labgrid that referenced this issue Mar 10, 2025
Add an addition optional arg "dest_authorized_keys" with the default
value of ```~/.ssh/authorized_keys```,

An example where this might be used is when an embedded system uses
dropbear as it's ssh server daemon.  In such a case, the authorized_keys
file is ```/etc/dropbear/authorized_keys```

Additionally, the ```put_key_file``` takes an optional
```dest_authorized_keys``` function parameter which defaults to the above arg.

Fixes: #labgrid-project#1626

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant