Wrong user/group of subdir and file created in /home/usernamedir/tmp
by mackowiakp from LinuxQuestions.org on (#5A6XN)
I have Debian Buster installed in LXC container on QNAP NAS. From container I run such script:
Code:debian@Debian:~/Pobrane$ cat ampli
#!/bin/bash
path_media="/share/homes/media/Pobrane/RADIO"
ssh_cmd="/usr/bin/ssh -p669 -x -q -i /home/debian/.ssh/id_debian admin@192.168.0.7"
[ ! -d /home/debian/tmp ] && mkdir /home/debian/tmp
$ssh_cmd $path_media/ampli $1 > /home/debian/tmp/ampliScript "ampli" returns text output to stdout. The content of output is ok.
But both "/home/debian/tmp" dir and "/home/debian/tmp/ampli" file have user/group - root/root. Should be debian/debian. Why is not? Any idea?


Code:debian@Debian:~/Pobrane$ cat ampli
#!/bin/bash
path_media="/share/homes/media/Pobrane/RADIO"
ssh_cmd="/usr/bin/ssh -p669 -x -q -i /home/debian/.ssh/id_debian admin@192.168.0.7"
[ ! -d /home/debian/tmp ] && mkdir /home/debian/tmp
$ssh_cmd $path_media/ampli $1 > /home/debian/tmp/ampliScript "ampli" returns text output to stdout. The content of output is ok.
But both "/home/debian/tmp" dir and "/home/debian/tmp/ampli" file have user/group - root/root. Should be debian/debian. Why is not? Any idea?