-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for specifying `--server ssh`, to automatically start and configure sshd in the virtme-ng guest, and `--client ssh` to connect to a virtme-ng guest via SSH. The server's port can be customized with the `--port NUM` option (default is 2222). Example usage (start a vng instance with sshd enabled): $ vng --server ssh --port 2222 In another shell session on the host, connect to the running instance as a client: $ vng --client ssh --port 2222 Note that it's also possible to use ssh or scp directly, the --client option is provided for convenience and to be consistent with the vsock option. Signed-off-by: Andrea Righi <[email protected]>
- Loading branch information
Showing
7 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# | ||
# Initialize ssh server for remote connections (option `--server ssh`) | ||
|
||
HOME=$(getent passwd "${virtme_user}" | cut -d: -f6) | ||
cat ${HOME}/.ssh/id_rsa.pub >> ${HOME}/.ssh/authorized_keys | ||
chown ${virtme_user} ${HOME}/.ssh/authorized_keys | ||
mkdir -p /run/sshd | ||
rm -f /var/run/nologin | ||
/usr/sbin/sshd -h ~/.ssh/id_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters