2014-11-06 2 views
0

Я пытаюсь запустить whoami на моей локальной машине в качестве пользователя pallet и, похоже, продолжает работать как пользователь deadghost.Запустить скрипт как указанный пользователь

(ns localhost.idk 
    (:require (pallet [compute :as compute] 
        [api :as api] 
        [actions :as actions]))) 

(def my-data-center 
    (compute/instantiate-provider 
    "node-list" 
    :node-list [["localhost" "whoami" "127.0.0.1" :ubuntu]])) 

(def user-pallet 
    (api/make-user "pallet" 
       :password "pallet" 
       :sudo-password nil 
       :public-key-path "/home/deadghost/.ssh/id_rsa.pub" 
       :private-key-path "/home/deadghost/.ssh/id_rsa" 
       :passphrase "my-ssh-passphrase-here")) 

(pallet.api/lift 
(pallet.api/group-spec 
    "whoami" 
    :phases {:configure (api/plan-fn 
         (pallet.actions/exec-script 
         ("whoami")))}) 
:compute my-data-center 
:user user-pallet) 

Возвращаемое значение lift. Выход deadghost:

{:initial-plan-state {:pallet.action/action-options {}}, 
:environment 
{:compute #<NodeList [email protected]>, 
    :user 
    {:username "pallet", 
    :public-key-path "/home/deadghost/.ssh/id_rsa.pub", 
    :private-key-path "/home/deadghost/.ssh/id_rsa", 
    :public-key nil, 
    :private-key nil, 
    :passphrase "my-ssh-passphrase-here", 
    :password "pallet", 
    :sudo-password nil, 
    :no-sudo nil, 
    :sudo-user nil, 
    :state-root nil, 
    :state-group nil}}, 
:results 
({:target 
    {:group-name :whoami, 
    :default-phases [:configure], 
    :phases 
    {:pallet/os 
    #<api$lift_STAR_$fn__14140 [email protected]>, 
    :configure 
    #<idk$eval14723$fn__14725 [email protected]>}, 
    :group-names #{:whoami}, 
    :node 
    {:name "localhost", 
    :group-name "whoami", 
    :ip "127.0.0.1", 
    :os-family :ubuntu, 
    :os-version nil, 
    :id "localhost-127-0-0-1", 
    :ssh-port 22, 
    :private-ip nil, 
    :is-64bit true, 
    :running true, 
    :service #<NodeList [email protected]>, 
    :hardware nil, 
    :proxy nil, 
    :image-user nil}}, 
    :target-type nil, 
    :plan-state 
    {:host 
    {"localhost-127-0-0-1" 
    {:pallet/os 
     {nil 
     {:context "os: ", 
     :action-symbol clj-action13784, 
     :id "Ubuntu", 
     :release "14.04", 
     :mach "i686", 
     :rev "3.13.0-39-generic", 
     :os "Linux", 
     :os-family :ubuntu, 
     :os-version "14.04"}}}}, 
    :pallet.action/action-options {}}, 
    :result 
    ({:err "", 
    :out "pallet:x:1001:1001:,,,:/home/pallet:/bin/bash\n", 
    :exit 0, 
    :flags #{}, 
    :flag-values {}, 
    :script 
    "#!/usr/bin/env bash\nmkdir -p /home/deadghost || exit 1\ncd /home/deadghost\nset -h\nif getent passwd pallet; then :;else /usr/sbin/useradd pallet;fi\nexit $?", 
    :action-symbol pallet.actions/user, 
    :context nil} 
    {:err "", 
    :out "deadghost\n", <------------ OUTPUTS DEADGHOST INSTEAD OF PALLET 
    :exit 0, 
    :flags #{}, 
    :flag-values {}, 
    :script 
    "#!/usr/bin/env bash\nmkdir -p /home/deadghost || exit 1\ncd /home/deadghost\nset -h\nwhoami\nexit $?", 
    :action-symbol pallet.actions/exec-script*, 
    :context nil}), 
    :phase :configure}), 
:targets 
({:group-name :whoami, 
    :default-phases [:configure], 
    :phases 
    {:pallet/os 
    #<api$lift_STAR_$fn__14140 [email protected]>, 
    :configure 
    #<idk$eval14723$fn__14725 [email protected]>}, 
    :group-names #{:whoami}, 
    :node 
    {:name "localhost", 
    :group-name "whoami", 
    :ip "127.0.0.1", 
    :os-family :ubuntu, 
    :os-version nil, 
    :id "localhost-127-0-0-1", 
    :ssh-port 22, 
    :private-ip nil, 
    :is-64bit true, 
    :running true, 
    :service #<NodeList [email protected]>, 
    :hardware nil, 
    :proxy nil, 
    :image-user nil}}), 
:plan-state 
{:node-values 
    {nv14946 
    {:err "", 
    :out "pallet:x:1001:1001:,,,:/home/pallet:/bin/bash\n", 
    :exit 0, 
    :flags #{}, 
    :flag-values {}, 
    :script 
    "#!/usr/bin/env bash\nmkdir -p /home/deadghost || exit 1\ncd /home/deadghost\nset -h\nif getent passwd pallet; then :;else /usr/sbin/useradd pallet;fi\nexit $?", 
    :action-symbol pallet.actions/user, 
    :context nil}, 
    nv14945 
    {:err "", 
    :out "deadghost\n", 
    :exit 0, 
    :flags #{}, 
    :flag-values {}, 
    :script 
    "#!/usr/bin/env bash\nmkdir -p /home/deadghost || exit 1\ncd /home/deadghost\nset -h\nwhoami\nexit $?", 
    :action-symbol pallet.actions/exec-script*, 
    :context nil}, 
    nv14933 
    {:id "Ubuntu", 
    :release "14.04", 
    :mach "i686", 
    :rev "3.13.0-39-generic", 
    :os "Linux", 
    :os-family :ubuntu, 
    :os-version "14.04", 
    :action-symbol clj-action13784, 
    :context "os: "}, 
    nv14932 
    {:os-version "14.04", 
    :os-family :ubuntu, 
    :os "Linux", 
    :rev "3.13.0-39-generic", 
    :mach "i686", 
    :release "14.04", 
    :id "Ubuntu", 
    :action-symbol clj-action13784, 
    :context "os: "}, 
    nv14931 
    {:release "14.04", 
    :id "Ubuntu", 
    :os-family :ubuntu, 
    :os-version "14.04", 
    :action-symbol clj-action13760, 
    :context "os: infer-distro: "}, 
    nv14930 
    {:err "", 
    :out "{\n:id \"Ubuntu\"\n:release \"14.04\"\n}\n", 
    :exit 0, 
    :flags #{}, 
    :flag-values {}, 
    :script 
    "#!/usr/bin/env bash\nmkdir -p /home/deadghost || exit 1\ncd /home/deadghost\nset -h\nif [ -e /etc/debconf_version ]; then\nID=$(cat /etc/redhat-release | egrep -o -e '^[A-Za-z ]+release' | sed -e 's/ release//')\nRELEASE=$(lsb_release -s -r)\nfi\nif [ -e /etc/lsb-release ]; then\nsource /etc/lsb-release\nID=${DISTRIB_ID}\nRELEASE=${DISTRIB_RELEASE}\nfi\nif [ -e /etc/redhat-release ]; then\nID=$(cat /etc/redhat-release | egrep -o -e '^[A-Za-z ]+release' | sed -e 's/ release//')\nRELEASE=$(cat /etc/redhat-release | sed -e 's/.*release//' | sed -e 's/[^0-9.]//g')\nfi\nif [ -e /etc/SUSE-release ]; then\nID=$(cat /etc/SUSE-release | tr ' ' | sed -e 's/VERSION.*//')\nRELEASE=$(cat /etc/SUSE-release | tr ' ' | sed -e 's/.*= //')\nfi\nif [ -e /etc/mandrake-release ]; then\nID=Mandrake\nRELEASE=$(cat /etc/mandrake-release | sed -e 's/.*release //' | sed -e 's/ .*//')\nfi\necho {\necho :id '\"'${ID:-unknown}'\"'\necho :release '\"'${RELEASE:-unknown}'\"'\necho }\n\nexit $?", 
    :action-symbol pallet.actions/exec-script*, 
    :context "os: infer-distro: "}, 
    nv14929 
    {:mach "i686", 
    :rev "3.13.0-39-generic", 
    :os "Linux", 
    :os-family :linux, 
    :os-version "3.13.0-39-generic", 
    :action-symbol clj-action13735, 
    :context "os: infer-os: "}, 
    nv14928 
    {:err "", 
    :out 
    "{\n:os \"Linux\"\n:rev \"3.13.0-39-generic\"\n:mach \"i686\"\n}\n", 
    :exit 0, 
    :flags #{}, 
    :flag-values {}, 
    :script 
    "#!/usr/bin/env bash\nmkdir -p /home/deadghost || exit 1\ncd /home/deadghost\nset -h\necho {\necho :os '\"'$(uname -s)'\"'\necho :rev '\"'$(uname -r)'\"'\necho :mach '\"'$(uname -m)'\"'\necho }\n\nexit $?", 
    :action-symbol pallet.actions/exec-script*, 
    :context "os: infer-os: "}}, 
    :host 
    {"localhost-127-0-0-1" 
    {:pallet/os 
    {nil 
    {:context "os: ", 
     :action-symbol clj-action13784, 
     :id "Ubuntu", 
     :release "14.04", 
     :mach "i686", 
     :rev "3.13.0-39-generic", 
     :os "Linux", 
     :os-family :ubuntu, 
     :os-version "14.04"}}}}, 
    :pallet.action/action-options {}}} 

Взятые из pallet.log:

2014-11-13 08:08:04,333 DEBUG [operate-92] p.c.operations lift :phases [:pallet/os :settings] :targets [:ed] 
2014-11-13 08:08:04,342 DEBUG [operate-94] p.c.primitives build-and-execute-phase :pallet/os on 1 target(s) 
2014-11-13 08:08:04,342 DEBUG [operate-94] p.c.api-impl target-os-details node {:packager :apt, :os-family :ubuntu} detected {} 
2014-11-13 08:08:04,342 DEBUG [operate-94] p.c.api-impl Script context: [:ubuntu :apt] 
2014-11-13 08:08:04,345 DEBUG [operate-94] p.core.api environment-execution-settings {:compute #<NodeList [email protected]>, :user #pallet.core.user.User{:username "pallet", :public-key-path "/home/deadghost/.ssh/id_rsa.pub", :private-key-path "/home/deadghost/.ssh/id_rsa", :public-key nil, :private-key nil, :passphrase "my-ssh-passphrase-here", :password "pallet", :sudo-password nil, :no-sudo nil, :sudo-user nil, :state-root nil, :state-group nil}} 
2014-11-13 08:08:04,345 DEBUG [operate-94] p.core.api Env user [email protected] 
2014-11-13 08:08:04,346 DEBUG [operate-94] p.c.api-impl target-os-details node {:packager :apt, :os-family :ubuntu} detected {} 
2014-11-13 08:08:04,346 DEBUG [operate-94] p.c.api-impl Script context: [:ubuntu :apt] 
2014-11-13 08:08:04,347 DEBUG [operate-94] p.l.execute localhost ==> ----------------------------------------- 
2014-11-13 08:08:04,347 DEBUG [operate-94] p.l.execute localhost ==> #!/usr/bin/env bash 
2014-11-13 08:08:04,347 DEBUG [operate-94] p.l.execute localhost ==> mkdir -p /home/deadghost || exit 1 
2014-11-13 08:08:04,347 DEBUG [operate-94] p.l.execute localhost ==> cd /home/deadghost 
2014-11-13 08:08:04,347 DEBUG [operate-94] p.l.execute localhost ==> set -h 
2014-11-13 08:08:04,347 DEBUG [operate-94] p.l.execute localhost ==> echo { 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> echo :os '"'$(uname -s)'"' 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> echo :rev '"'$(uname -r)'"' 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> echo :mach '"'$(uname -m)'"' 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> echo } 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> exit $? 
2014-11-13 08:08:04,348 DEBUG [operate-94] p.l.execute localhost ==> ------------------------------------------ 
2014-11-13 08:08:04,358 DEBUG [operate-94] p.l.execute localhost <== ---------------------------------------- 
2014-11-13 08:08:04,358 DEBUG [operate-94] p.script-builder {:script-dir "/home/deadghost", :default-script-prefix :no-sudo} 
2014-11-13 08:08:04,358 DEBUG [operate-94] p.script-builder prefix kw :no-sudo 
2014-11-13 08:08:04,358 DEBUG [operate-94] p.l.execute localhost {:env-cmd "/usr/bin/env", :env nil, :env-fwd [:SSH_AUTH_SOCK], :prefix nil, :execv ("/bin/bash" "/tmp/pallet8828719639020449641script")} 
2014-11-13 08:08:05,360 DEBUG [operate-94] p.execute localhost <== { 
2014-11-13 08:08:05,360 DEBUG [operate-94] p.execute localhost <== :os "Linux" 
2014-11-13 08:08:05,360 DEBUG [operate-94] p.execute localhost <== :rev "3.13.0-39-generic" 
2014-11-13 08:08:05,360 DEBUG [operate-94] p.execute localhost <== :mach "i686" 
2014-11-13 08:08:05,360 DEBUG [operate-94] p.execute localhost <== } 
2014-11-13 08:08:05,361 DEBUG [operate-94] p.l.execute localhost <== ---------------------------------------- 
2014-11-13 08:08:05,362 DEBUG [operate-94] p.l.execute clojure-on-origin pallet.crate.os$inf[email protected]15798c9 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> ----------------------------------------- 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> #!/usr/bin/env bash 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> mkdir -p /home/deadghost || exit 1 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> cd /home/deadghost 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> set -h 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> if [ -e /etc/debconf_version ]; then 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> ID=$(cat /etc/redhat-release | egrep -o -e '^[A-Za-z ]+release' | sed -e 's/ release//') 
2014-11-13 08:08:05,367 DEBUG [operate-94] p.l.execute localhost ==> RELEASE=$(lsb_release -s -r) 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> fi 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> if [ -e /etc/lsb-release ]; then 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> source /etc/lsb-release 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> ID=${DISTRIB_ID} 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> RELEASE=${DISTRIB_RELEASE} 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> fi 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> if [ -e /etc/redhat-release ]; then 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> ID=$(cat /etc/redhat-release | egrep -o -e '^[A-Za-z ]+release' | sed -e 's/ release//') 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> RELEASE=$(cat /etc/redhat-release | sed -e 's/.*release//' | sed -e 's/[^0-9.]//g') 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> fi 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> if [ -e /etc/SUSE-release ]; then 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> ID=$(cat /etc/SUSE-release | tr ' ' | sed -e 's/VERSION.*//') 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> RELEASE=$(cat /etc/SUSE-release | tr ' ' | sed -e 's/.*= //') 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> fi 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> if [ -e /etc/mandrake-release ]; then 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> ID=Mandrake 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> RELEASE=$(cat /etc/mandrake-release | sed -e 's/.*release //' | sed -e 's/ .*//') 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> fi 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> echo { 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> echo :id '"'${ID:-unknown}'"' 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> echo :release '"'${RELEASE:-unknown}'"' 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> echo } 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> exit $? 
2014-11-13 08:08:05,368 DEBUG [operate-94] p.l.execute localhost ==> ------------------------------------------ 
2014-11-13 08:08:05,371 DEBUG [operate-94] p.l.execute localhost <== ---------------------------------------- 
2014-11-13 08:08:05,371 DEBUG [operate-94] p.script-builder {:script-dir "/home/deadghost", :default-script-prefix :no-sudo} 
2014-11-13 08:08:05,371 DEBUG [operate-94] p.script-builder prefix kw :no-sudo 
2014-11-13 08:08:05,372 DEBUG [operate-94] p.l.execute localhost {:env-cmd "/usr/bin/env", :env nil, :env-fwd [:SSH_AUTH_SOCK], :prefix nil, :execv ("/bin/bash" "/tmp/pallet4201262849437841643script")} 
2014-11-13 08:08:06,373 DEBUG [operate-94] p.execute localhost <== { 
2014-11-13 08:08:06,373 DEBUG [operate-94] p.execute localhost <== :id "Ubuntu" 
2014-11-13 08:08:06,374 DEBUG [operate-94] p.execute localhost <== :release "14.04" 
2014-11-13 08:08:06,374 DEBUG [operate-94] p.execute localhost <== } 
2014-11-13 08:08:06,375 DEBUG [operate-94] p.l.execute localhost <== ---------------------------------------- 
2014-11-13 08:08:06,375 DEBUG [operate-94] p.l.execute clojure-on-origin pallet.crate.os$infer_d[email protected]1c412ce 
2014-11-13 08:08:06,375 DEBUG [operate-94] p.l.execute clojure-on-origin pallet.crate.[email protected]1aebe5f 
2014-11-13 08:08:06,376 DEBUG [operate-94] p.l.execute clojure-on-origin pallet.actions.d[email protected]1546d95 
2014-11-13 08:08:06,386 DEBUG [operate-93] p.c.primitives build-and-execute-phase :settings on 1 target(s) 
2014-11-13 08:08:06,397 DEBUG [operate-94] p.c.operations lift-partitions :phases [:configure] :targets [:ed] 
2014-11-13 08:08:06,400 DEBUG [operate-93] p.c.operations lift :phases [:configure] :targets [:ed] 
2014-11-13 08:08:06,404 DEBUG [operate-94] p.c.primitives build-and-execute-phase :configure on 1 target(s) 
2014-11-13 08:08:06,405 DEBUG [operate-94] p.c.api-impl target-os-details node {:packager :apt, :os-family :ubuntu} detected {:os-version "14.04", :os-family :ubuntu} 
2014-11-13 08:08:06,405 DEBUG [operate-94] p.c.api-impl Script context: [:ubuntu :apt :ubuntu-14.04] 
2014-11-13 08:08:06,412 DEBUG [operate-92] p.core.api environment-execution-settings {:compute #<NodeList [email protected]>, :user #pallet.core.user.User{:username "pallet", :public-key-path "/home/deadghost/.ssh/id_rsa.pub", :private-key-path "/home/deadghost/.ssh/id_rsa", :public-key nil, :private-key nil, :passphrase "my-ssh-passphrase-here", :password "pallet", :sudo-password nil, :no-sudo nil, :sudo-user nil, :state-root nil, :state-group nil}} 
2014-11-13 08:08:06,413 DEBUG [operate-92] p.core.api Env user [email protected] 
2014-11-13 08:08:06,415 DEBUG [operate-92] p.c.api-impl target-os-details node {:packager :apt, :os-family :ubuntu} detected {:os-version "14.04", :os-family :ubuntu} 
2014-11-13 08:08:06,415 DEBUG [operate-92] p.c.api-impl Script context: [:ubuntu :apt :ubuntu-14.04] 
2014-11-13 08:08:06,416 DEBUG [operate-92] p.l.execute localhost ==> ----------------------------------------- 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> #!/usr/bin/env bash 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> mkdir -p /home/deadghost || exit 1 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> cd /home/deadghost 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> set -h 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> whoami 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> exit $? 
2014-11-13 08:08:06,417 DEBUG [operate-92] p.l.execute localhost ==> ------------------------------------------ 
2014-11-13 08:08:06,421 DEBUG [operate-92] p.l.execute localhost <== ---------------------------------------- 
2014-11-13 08:08:06,421 DEBUG [operate-92] p.script-builder {:script-dir "/home/deadghost", :default-script-prefix :no-sudo} 
2014-11-13 08:08:06,421 DEBUG [operate-92] p.script-builder prefix kw :no-sudo 
2014-11-13 08:08:06,421 DEBUG [operate-92] p.l.execute localhost {:env-cmd "/usr/bin/env", :env nil, :env-fwd [:SSH_AUTH_SOCK], :prefix nil, :execv ("/bin/bash" "/tmp/pallet3318318864438163863script")} 
2014-11-13 08:08:07,427 DEBUG [operate-92] p.execute localhost <== deadghost 
2014-11-13 08:08:07,428 DEBUG [operate-92] p.l.execute localhost <== ---------------------------------------- 

ответ

0

Не уверен, что ваш пример показывает и то, что вопрос ...

Почему вы пытаетесь создать пользователя от ваш палец-пользователь (я говорю о "(actions/user (: user user-pallet))")? Pls. удалите, чтобы сделать ваш вопрос более понятным.

Имеет ли пользователь поддона на вашем локальном хосте? Возможно ли это?

Какой дисплей выводит консоль? С выходом консоли я подразумеваю sth. например

20:57:56.305 [operate-57] DEBUG pallet.ssh.execute - authentication {:sudo-user nil, :state-group nil, :private-key nil, :public-key nil, :sudo-password "*******", :private-key-path nil, :no-sudo false, :public-key-path nil, :passphrase nil, :username "initial", :state-root nil, :password "*******"} 
20:57:56.305 [operate-57] DEBUG pallet.ssh.transport - SSH user initial :private-key-path null :private-key null :password ******* 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> ----------------------------------------- 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> #!/usr/bin/env bash 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> set -h 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> echo { 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> echo :os '"'$(uname -s)'"' 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> echo :rev '"'$(uname -r)'"' 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> echo :mach '"'$(uname -m)'"' 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> echo } 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> exit $? 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 ==> ------------------------------------------ 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15:22 send script via /tmp/palletxhoLT as root 
20:57:56.407 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 <== ---------------------------------------- 
20:57:56.409 [operate-57] DEBUG pallet.ssh.transport - send-text set mode /tmp/palletxhoLT 384 
20:57:56.411 [operate-57] DEBUG pallet.script-builder - {} 
20:57:56.411 [operate-57] DEBUG pallet.script-builder - prefix kw :sudo 
20:57:56.412 [operate-57] DEBUG pallet.script-builder - prefix sudo {:sudo-user nil, :node-value-path nv20675, :state-group nil, :context ("os" "infer-os"), :private-key nil, :public-key nil, :sudo-password "test123", :private-key-path nil, :args ("echo {\necho :os '\"'$(uname -s)'\"'\necho :rev '\"'$(uname -r)'\"'\necho :mach '\"'$(uname -m)'\"'\necho }\n"), :no-sudo false, :action {:action-symbol pallet.actions/exec-script*, :impls #<[email protected]: {:direct {:f #<exec_script$eval11637$exec_script_STAR__direct__11638 pallet.actio[email protected]705e0e14>, :metadata {:location :target, :action-type :script}}}>, :execution :in-sequence, :precedence {}}, :public-key-path nil, :passphrase nil, :username "initial", :state-root nil, :password "test123"} 
20:57:56.412 [operate-57] DEBUG pallet.script-builder - sudo-cmd-for {:username "initial", :sudo-password "test123", :sudo-user nil, :password "test123", :no-sudo false} 
20:57:56.412 [operate-57] DEBUG pallet.script-builder - prefix echo 'test123' | /usr/bin/sudo -S 
20:57:56.412 [operate-57] DEBUG pallet.ssh.execute - ssh-script-on-target command {:env-cmd "/usr/bin/env", :env nil, :env-fwd [:SSH_AUTH_SOCK], :prefix ["echo" "'test123'" "|" "/usr/bin/sudo" "-S"], :execv ("/bin/bash" "/tmp/palletxhoLT")} 
20:57:56.514 [operate-57] DEBUG pallet.execute - 192.168.35.15 <== [sudo] password for initial: { 
20:57:56.514 [operate-57] DEBUG pallet.execute - 192.168.35.15 <== :os "Linux" 
20:57:56.514 [operate-57] DEBUG pallet.execute - 192.168.35.15 <== :rev "3.5.0-23-generic" 
20:57:56.514 [operate-57] DEBUG pallet.execute - 192.168.35.15 <== :mach "x86_64" 
20:57:56.514 [operate-57] DEBUG pallet.execute - 192.168.35.15 <== } 
20:57:56.616 [operate-57] DEBUG pallet.ssh.execute - 192.168.35.15 <== ---------------------------------------- 
20:57:56.616 [operate-57] DEBUG pallet.executors - default-executor 
+0

Я просто пытаюсь запустить '$ whoami' как пользовательский паллет на моей локальной машине. Пользователь 'pallet' существует с паролем' pallet' и с настройкой sudo без пароля. Если вы используете консольный вывод, вы имеете в виду результат запуска скрипта 'whoami'' 'deadghost', который можно найти в возвращаемом значении' lift'. – deadghost

+0

1. Действие, о котором я упоминал, создаст пользователя на вашей цели. Я не уверен, смогу ли я правильно отобразить вывод в действие whoami. – jerger

+0

2. Пример вывода консоли, который вы можете найти в моем ответе ... для меня это более понятно читать ... – jerger

Смежные вопросы