Add ssh client module code
PATCH v2 4/5 Add ssh client module code
Add ssh client module which support ssh key mode and interactive mode. with --sshkey option you can provide the ssh key to be installed
Quoted 1 line
why not call it "ssh" module?
ssh-client is better, maybe future there will be ssh-server come in. In debian these are also two different packages.
Usage:
1. sshkey mode:
transfer your public key to remote machine with ssh-copy-id or do it mannaully example of options:
./dracut -l -H -a ssh-client --sshkey /root/.ssh/id_rsa i.img
2. interactive mode:
need use --ctty option, ie.:
./dracut -l -H -a ssh-client --ctty i.img
[v2 changes]:
per wangcong: add patch description about module name add help line in usage()
remove useless comment
--- dracut | 4 ++- dracut.8.xml | 8 ++++ modules.d/95ssh-client/module-setup.sh | 60 ++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletions(-) create mode 100644 modules.d/95ssh-client/module-setup.sh
dracut +3 -1
@@ -118,6 +118,7 @@ Creates initial ramdisk images for preloading modules -M, --show-modules Print included module's name to standard output during build. --keep Keep the temporary initramfs for debugging purposes + --sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module) EOF }
@@ -233,6 +234,7 @@ while (($# > 0)); do --debug) debug="yes";; --profile) profile="yes";; --ctty) cttyhack="yes";; + --sshkey) read_arg sshkey "$@" || shift;; -v|--verbose) ((verbosity_mod_l++));; -q|--quiet) ((verbosity_mod_l--));; -l|--local) allowlocal="yes" ;;
@@ -590,7 +592,7 @@ export initdir dracutbasedir dracutmodules drivers \ add_drivers mdadmconf lvmconf filesystems \ use_fstab libdir usrlibdir fscks nofscks cttyhack \ stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ - debug host_fs_types host_devs + debug host_fs_types host_devs sshkey # Create some directory structure first [[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
dracut.8.xml +8 -0
@@ -370,6 +370,14 @@ Default: </varlistentry> <varlistentry> <term> + <option>--sshkey <replaceable><sshkey file></replaceable></option> + </term> + <listitem> + <para>ssh key file used with ssh-client module.</para> + </listitem> + </varlistentry> + <varlistentry> + <term> <option>-l</option> </term> <term>
modules.d/95ssh-client/module-setup.sh new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
1.7.1
A message that is not in the archive (sent off-list or not yet received): 20111226062920.GA3147-4/[email protected]
Am 26.12.2011 07:29, schrieb Dave Young:
Quoted 16 lines
Add ssh client module which support ssh key mode and interactive mode. with --sshkey option you can provide the ssh key to be installed
Quoted 1 line
why not call it "ssh" module?
ssh-client is better, maybe future there will be ssh-server come in. In debian these are also two different packages.
Usage:
1. sshkey mode:
transfer your public key to remote machine with ssh-copy-id or do it mannaully example of options:
./dracut -l -H -a ssh-client --sshkey/root/.ssh/id_rsai.img
2. interactive mode:
need use --ctty option, ie.:
./dracut -l -H -a ssh-client --ctty i.img
Quoted 6 lines
[v2 changes]:
per wangcong: add patch description about module name add help line inusage()
remove useless commentSigned-off-by Dave Young <[email protected]>
pushed