I'm trying to have an unattended remote PC log some data on my home PC.
According to
man sshd, I should be able to put a command in authorized_keys.
The key I'm using is a special key that isn't used elsewhere.
In my
~/.ssh/authorized_keys file on my desktop:
Code:
command="/bin/cat >> /home/user/text/limited.log" ssh-dss AAAAB3Nz ...
Then to write the data, I issue this command on the remote machine, where
desk_pc is the IP of my desk PC:
Code:
echo "$(date +%D) Data ...." | ssh -x -i ~/.ssh/special_id_dsa desk_pc
This doesn't work.
I think my desktop it's trying execute the received text instead of cat it to the log file. This is displayed on the remote machine:
Code:
Pseudo-terminal will not be allocated because stdin is not a terminal.
-bash: line 1: 07/09/11: No such file or directory
Do I need a pty? How can I get stdin written to a file without a pty if I need one?
How do I get it to execute the /bin/cat command, not the received text?