search for: do_ssh_inject_unix

Displaying 7 results from an estimated 7 matches for "do_ssh_inject_unix".

2014 Nov 03
1
Re: [PATCH] customize: Add --ssh-inject option for injecting SSH keys.
On Monday 03 November 2014 19:36:21 Pino Toscano wrote: > +val do_ssh_inject_unix : Guestfs.guestfs -> string -> ssh_key_selector -> unit > +(** ... *) Err... this is supposed to be: (** Inject on a generic Unix system (Linux, FreeBSD, etc) the ssh key for the specified user. *) (already fixed locally.) -- Pino Toscano
2016 May 19
2
[PATCH 1/2] customize: minor function factoring in ssh_key
...ste for other details. Mostly code motion. --- customize/ssh_key.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/customize/ssh_key.ml b/customize/ssh_key.ml index a4e4a51..7c482e7 100644 --- a/customize/ssh_key.ml +++ b/customize/ssh_key.ml @@ -106,13 +106,15 @@ let do_ssh_inject_unix (g : Guestfs.guestfs) user selector = (* Get user's home directory. *) g#aug_init "/" 0; - let home_dir = + let read_user_detail what = try - let expr = sprintf "/files/etc/passwd/%s/home" user in + let expr = sprintf "/files/etc/passwd/%s/%s&qu...
2015 Sep 07
1
[PATCH] customize: Create .ssh as 0700 and .ssh/authorized_keys as 0600 (RHBZ#1260778).
...--- customize/ssh_key.ml | 4 ++-- src/guestfs.pod | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/customize/ssh_key.ml b/customize/ssh_key.ml index 09664bf..dd6056f 100644 --- a/customize/ssh_key.ml +++ b/customize/ssh_key.ml @@ -119,14 +119,14 @@ let do_ssh_inject_unix (g : Guestfs.guestfs) user selector = let ssh_dir = sprintf "%s/.ssh" home_dir in if not (g#exists ssh_dir) then ( g#mkdir ssh_dir; - g#chmod 0o755 ssh_dir + g#chmod 0o700 ssh_dir ); (* Create ~user/.ssh/authorized_keys if it doesn't exist. *) let auth_keys...
2014 Nov 03
0
[PATCH] customize: Add --ssh-inject option for injecting SSH keys.
...g#scrub_file path + | `SSHInject (user, selector) -> + (match g#inspect_get_type root with + | "linux" | "freebsd" | "netbsd" | "openbsd" | "hurd" -> + msg (f_"SSH key inject: %s") user; + Ssh_key.do_ssh_inject_unix g user selector + | _ -> + warning (f_"SSH key could be injected for this type of guest")) + | `Timezone tz -> msg (f_"Setting the timezone: %s") tz; if not (Timezone.set_timezone g root tz) then diff --git a/customize/ssh_key.ml b/customize/...
2014 Nov 02
3
[PATCH] customize: Add --ssh-inject option for injecting SSH keys.
This adds a customize option: virt-customize --ssh-inject USER[=KEY] virt-builder --ssh-inject USER[=KEY] virt-sysprep --ssh-inject USER[=KEY] In each case this either injects the current (host) user's ssh pubkey into the guest user USER (adding it to ~USER/.ssh/authorized_keys in the guest), or you can specify a particular key. For example: virt-builder fedora-20 --ssh-inject root
2016 May 19
0
[PATCH 2/2] customize: fix ownership when creating ~/.ssh/authorized_keys (RHBZ#1337561)
...rget user. If not, they are owned by root. --- customize/ssh_key.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/customize/ssh_key.ml b/customize/ssh_key.ml index 7c482e7..d05816c 100644 --- a/customize/ssh_key.ml +++ b/customize/ssh_key.ml @@ -115,20 +115,24 @@ let do_ssh_inject_unix (g : Guestfs.guestfs) user selector = user in let home_dir = read_user_detail "home" in + let uid = int_of_string (read_user_detail "uid") in + let gid = int_of_string (read_user_detail "gid") in g#aug_close (); (* Create ~user/.ssh if it doesn...
2016 Dec 14
5
[PATCH v3 0/5] sysprep: Remove various backup files.
v3: - Split out test for "unix-like" guest OSes into separate commit. - Add guestfish --format=qcow2 to the test (x2). Rich.