Failed to create temporary directory

Okay apologies.

This is the key message here.

Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory.

Permissions.

no it is not getting creating on my remote machine which is debian

/home/shared is the directory on my target or remote machine which has 777 permission as well as temproot also has sudo permission

what does this mean by “target directory” which directory it is referring to?

Sorry, I do not understand that answer.

What do you see in the log files on your Debian machine at the time you run the
ansible command on your Centos machine?

I would expect to find entries in /var/log/syslog and/or /var/log/auth.log on
the Debian machine when a remote user connects by SSH and runs a command.

Antony.

Please log on to the Debian machine and paste here the results of the
commands:

  ls -al /home/shared

  grep temproot /etc/passwd

Antony.

ls -al /home/shared
total 24
drwxrwxrwx 3 root root 4096 Jun 18 22:37 .
drwxr-xr-x 6 root root 4096 Jun 18 10:28 …
-rw-r–r-- 1 root root 1930 Jun 18 08:52 .bash_profile
-rw-r–r-- 1 root root 715 Jun 18 08:52 .bashrc
drwxr-xr-x 2 root root 4096 Jun 18 11:01 scripts
-rw------- 1 temproot osgroup 754 Jun 18 22:37 .viminfo

grep temproot /etc/passwd
temproot:x:1000:1001::/home/shared:/bin/bash

ls -al /home/shared
total 24
drwxrwxrwx 3 root root 4096 Jun 18 22:37 .

This directory is owned by root.

Is there any good reason why you do not do "chown temproot: /home/shared" on
this machine?

grep temproot /etc/passwd
temproot:x:1000:1001::/home/shared:/bin/bash

Hm, what does "grep 1001 /etc/group" show?

Antony.

grep 1001 /etc/group
osgroup:x:1001:

i did change the file owner to temproot :-
total 24
drwxrwxrwx 3 temproot osgroup 4096 Jun 18 22:37 .
drwxr-xr-x 6 root root 4096 Jun 18 10:28 …
-rw-r–r-- 1 root root 1930 Jun 18 08:52 .bash_profile
-rw-r–r-- 1 root root 715 Jun 18 08:52 .bashrc
drwxr-xr-x 2 root root 4096 Jun 18 11:01 scripts
-rw------- 1 temproot osgroup 754 Jun 18 22:37 .viminfo
temproot@localhost:~$ pwd
/home/shared

So, there are no other members of the group "osgroup".

I still fail to understand why the home directory for "temproot" is not owned
by temproot.

Antony.

Okay.

1. Has that made any difference to the output from running your ansible
commands?

2. What do the log files such as /var/log/auth.log and /var/log/syslog on the
Debian machine you are targetting tell you is happening when you run the
commands on the Centos ansible server?

Antony.

now i made it to temproot, now also i am facing the same issue

there is no such file on the debian machine

Please show us what appears in the log files on the Debian machine for the
timestamps when you run the ansible command.

Antony.

/var/log$ ls
alarm.log apps.log.4.gz dpkg.log lastlog private sysstat ztp.log
alternatives.log apt drift linecard.log restconf-command.log tl1-command.log
apps.log btmp event.log messages.log security.log user.log
apps.log.1.gz cli-command.log extclient.log netconf-command.log shell-command.log watchdog
apps.log.2.gz configuration.log faillog nginx sim wtmp
apps.log.3.gz crashlogs kernel.log pcp sysinfo.log xmm4_fdr

these are the files i can see in my log folder

Please paste the output of:

  ls /var/log

Antony.

Jun 18 22:58:41 localhost sal[6649]: 11817:ArpUpdaterTh INFO {ArpUpdater.cpp:396} handleNLNeighMsg: NeighMsgType: NewNeigh NeighState: Failed
Jun 18 22:58:41 localhost sal[6649]: 11817:ArpUpdaterTh INFO {ArpUpdater.cpp:400} handleNLNeighMsg: Delete Arp for 19.88.4.49
Jun 18 22:58:41 localhost sal[6649]: 11817:ArpUpdaterTh INFO {L3Db.cpp:707} deleteArp: Dst:0x13580431 VrfId:0
Jun 18 22:58:41 localhost sal[6649]: 11817:ArpUpdaterTh ERROR {L3Db.cpp:745} deleteArp: RtEntry does not exist
Jun 18 22:58:41 localhost SdaServer[5970]: agent: error joining: 1 error occurred:

, retrying in 10s
Jun 18 22:58:44 localhost sal[6649]: 11817:ArpUpdaterTh INFO {ArpUpdater.cpp:396} handleNLNeighMsg: NeighMsgType: NewNeigh NeighState: Failed
Jun 18 22:58:44 localhost sal[6649]: 11817:ArpUpdaterTh INFO {ArpUpdater.cpp:400} handleNLNeighMsg: Delete Arp for 19.88.4.49
Jun 18 22:58:44 localhost sal[6649]: 11817:ArpUpdaterTh INFO {L3Db.cpp:707} deleteArp: Dst:0x13580431 VrfId:0
Jun 18 22:58:44 localhost sal[6649]: 11817:ArpUpdaterTh ERROR {L3Db.cpp:745} deleteArp: RtEntry does not exist
Jun 18 22:58:50 localhost sshd[8612]: debug1: Forked child 20582.
Jun 18 22:58:50 localhost sshd[20582]: debug1: Set /proc/self/oom_score_adj to 0
Jun 18 22:58:50 localhost sshd[20582]: debug1: rexec start in 13 out 13 newsock 13 pipe 15 sock 16
Jun 18 22:58:50 localhost sshd[20582]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Jun 18 22:58:50 localhost sshd[20582]: debug1: inetd sockets after dupping: 3, 3
Jun 18 22:58:50 localhost sshd[20582]: Connection from 10.220.6.50 port 36048 on 172.16.12.215 port 8022
Jun 18 22:58:50 localhost sshd[20582]: debug1: Client protocol version 2.0; client software version OpenSSH_7.4
Jun 18 22:58:50 localhost sshd[20582]: debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
Jun 18 22:58:50 localhost sshd[20582]: debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
Jun 18 22:58:50 localhost sshd[20582]: debug1: permanently_set_uid: 105/65534 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: list_hostkey_types: ssh-rsa,ecdsa-sha2-nistp521 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: SSH2_MSG_KEXINIT received [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: kex: algorithm: ecdh-sha2-nistp256 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: kex: host key algorithm: ecdsa-sha2-nistp521 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: zlib@openssh.com [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: zlib@openssh.com [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: rekey after 4294967296 blocks [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: SSH2_MSG_NEWKEYS received [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: rekey after 4294967296 blocks [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: KEX done [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: userauth-request for user temproot service ssh-connection method none [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: attempt 0 failures 0 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: user temproot does not match group list nogroup at line 37
Jun 18 22:58:50 localhost sshd[20582]: debug1: connection from 172.16.12.215 matched ‘LocalPort 8022’ at line 52
Jun 18 22:58:50 localhost sshd[20582]: debug1: PAM: initializing for “temproot”
Jun 18 22:58:50 localhost sshd[20582]: debug1: PAM: setting PAM_RHOST to “10.220.6.50”
Jun 18 22:58:50 localhost sshd[20582]: debug1: PAM: setting PAM_TTY to “ssh”
Jun 18 22:58:50 localhost sshd[20582]: debug1: userauth-request for user temproot service ssh-connection method publickey [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: attempt 1 failures 0 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedKeyTypes [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: userauth-request for user temproot service ssh-connection method password [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: attempt 2 failures 1 [preauth]
Jun 18 22:58:50 localhost sshd[20582]: debug1: PAM: password authentication accepted for temproot
Jun 18 22:58:50 localhost sshd[20582]: debug1: do_pam_account: called
Jun 18 22:58:51 localhost sshd[20582]: Accepted password for temproot from 10.220.6.50 port 36048 ssh2
Jun 18 22:58:51 localhost sshd[20582]: debug1: monitor_child_preauth: temproot has been authenticated by privileged process
Jun 18 22:58:51 localhost sshd[20582]: debug1: Enabling compression at level 6. [preauth]
Jun 18 22:58:51 localhost sshd[20582]: debug1: monitor_read_log: child log fd closed
Jun 18 22:58:51 localhost sshd[20582]: debug1: PAM: establishing credentials
Jun 18 22:58:51 localhost sshd[20582]: User child is on pid 20594
Jun 18 22:58:51 localhost sshd[20594]: debug1: SELinux support disabled
Jun 18 22:58:51 localhost sshd[20594]: debug1: PAM: establishing credentials
Jun 18 22:58:51 localhost sshd[20594]: debug1: permanently_set_uid: 1000/1001
Jun 18 22:58:51 localhost sshd[20594]: debug1: rekey after 4294967296 blocks
Jun 18 22:58:51 localhost sshd[20594]: debug1: rekey after 4294967296 blocks
Jun 18 22:58:51 localhost sshd[20594]: debug1: ssh_packet_set_postauth: called
Jun 18 22:58:51 localhost sshd[20594]: debug1: Enabling compression at level 6.
Jun 18 22:58:51 localhost sshd[20594]: debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Jun 18 22:58:51 localhost sshd[20594]: debug1: Entering interactive session for SSH2.
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_init_dispatch
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_open: ctype session rchan 2 win 2097152 max 32768
Jun 18 22:58:51 localhost sshd[20594]: debug1: input_session_request
Jun 18 22:58:51 localhost sshd[20594]: debug1: channel 0: new [server-session]
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_new: session 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_open: channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_open: session 0: link with channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_open: confirm session
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_req: channel 0 request env reply 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_input_channel_req: session 0 req env
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_req: channel 0 request exec reply 1
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_input_channel_req: session 0 req exec
Jun 18 22:58:51 localhost sshd[20594]: Starting session: forced-command (config) ‘/opt/infinera/thanos/local/bin/ssh_direct_wrapper.sh’ for temproot from 10.220.6.50 port 36048 id 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: Received SIGCHLD.
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_pid: pid 20595
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_exit_message: session 0 channel 0 pid 20595
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_exit_message: release channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_close_by_channel: channel 0 child 0
Jun 18 22:58:51 localhost sshd[20594]: Close session: user temproot from 10.220.6.50 port 36048 id 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: channel 0: free: server-session, nchannels 1
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_open: ctype session rchan 2 win 2097152 max 32768
Jun 18 22:58:51 localhost sshd[20594]: debug1: input_session_request
Jun 18 22:58:51 localhost sshd[20594]: debug1: channel 0: new [server-session]
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_new: session 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_open: channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_open: session 0: link with channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_open: confirm session
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_req: channel 0 request env reply 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_input_channel_req: session 0 req env
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_req: channel 0 request exec reply 1
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_input_channel_req: session 0 req exec
Jun 18 22:58:51 localhost sshd[20594]: Starting session: forced-command (config) ‘/opt/infinera/thanos/local/bin/ssh_direct_wrapper.sh’ for temproot from 10.220.6.50 port 36048 id 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: Received SIGCHLD.
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_pid: pid 20600
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_exit_message: session 0 channel 0 pid 20600
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_exit_message: release channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_close_by_channel: channel 0 child 0
Jun 18 22:58:51 localhost sshd[20594]: Close session: user temproot from 10.220.6.50 port 36048 id 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: channel 0: free: server-session, nchannels 1
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_open: ctype session rchan 2 win 2097152 max 32768
Jun 18 22:58:51 localhost sshd[20594]: debug1: input_session_request
Jun 18 22:58:51 localhost sshd[20594]: debug1: channel 0: new [server-session]
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_new: session 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_open: channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_open: session 0: link with channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_open: confirm session
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_req: channel 0 request env reply 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_input_channel_req: session 0 req env
Jun 18 22:58:51 localhost sshd[20594]: debug1: server_input_channel_req: channel 0 request exec reply 1
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_input_channel_req: session 0 req exec
Jun 18 22:58:51 localhost sshd[20594]: Starting session: forced-command (config) ‘/opt/infinera/thanos/local/bin/ssh_direct_wrapper.sh’ for temproot from 10.220.6.50 port 36048 id 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: Received SIGCHLD.
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_pid: pid 20605
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_exit_message: session 0 channel 0 pid 20605
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_exit_message: release channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_by_channel: session 0 channel 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: session_close_by_channel: channel 0 child 0
Jun 18 22:58:51 localhost sshd[20594]: Close session: user temproot from 10.220.6.50 port 36048 id 0
Jun 18 22:58:51 localhost sshd[20594]: debug1: channel 0: free: server-session, nchannels 1
Jun 18 22:58:51 localhost SdaServer[5970]: agent: Joining cluster…(replay: false)
Jun 18 22:58:51 localhost SdaServer[5970]: agent: joining: [19.88.4.49] replay: false
Jun 18 22:58:54 localhost sshd[24534]: debug1: Got 100/185 for keepalive
Jun 18 22:58:54 localhost sshd[24534]: debug1: Got 100/186 for keepalive
Jun 18 22:58:54 localhost sal[6649]: 11817:ArpUpdaterTh INFO {ArpUpdater.cpp:396} handleNLNeighMsg: NeighMsgType: NewNeigh NeighState: Failed
Jun 18 22:58:54 localhost sal[6649]: 11817:ArpUpdaterTh INFO {ArpUpdater.cpp:400} handleNLNeighMsg: Delete Arp for 19.88.4.49
Jun 18 22:58:54 localhost sal[6649]: 11817:ArpUpdaterTh INFO {L3Db.cpp:707} deleteArp: Dst:0x13580431 VrfId:0
Jun 18 22:58:54 localhost sal[6649]: 11817:ArpUpdaterTh ERROR {L3Db.cpp:745} deleteArp: RtEntry does not exist
Jun 18 22:58:54 localhost SdaServer[5970]: agent: error joining: 1 error occurred:

, retrying in 10s
Jun 18 22:58:57 localhost sal[6649]: 11886:ArpUpdaterTh INFO {ArpUpdater.cpp:396} handleNLNeighMsg: NeighMsgType: NewNeigh NeighState: Failed
Jun 18 22:58:57 localhost sal[6649]: 11886:ArpUpdaterTh INFO {ArpUpdater.cpp:400} handleNLNeighMsg: Delete Arp for 19.88.4.49
Jun 18 22:58:57 localhost sal[6649]: 11886:ArpUpdaterTh INFO {L3Db.cpp:707} deleteArp: Dst:0x13580431 VrfId:0
Jun 18 22:58:57 localhost sal[6649]: 11886:ArpUpdaterTh ERROR {L3Db.cpp:745} deleteArp: RtEntry does not exist
Jun 18 22:59:04 localhost SdaServer[5970]: agent: Joining cluster…(replay: false)
Jun 18 22:59:04 localhost SdaServer[5970]: agent: joining: [19.88.4.49] replay: false
Jun 18 22:59:04 localhost sshd[24405]: debug1: Got 100/1458 for keepalive

I'm sorry - I am out of my depth here - this is unlike any Debian machine I
have ever worked on - so many expected things are missing and so many
unexpected things exist. I have no idea how this machine has been set up.

I hope someone else may be able to chip in and suggest how to debug this
further.

Antony.

Can you wipe and reinstall the Debian system?