Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was using the GUI version of Transmission for Ubuntu. When my torrents were downloaded I ran the following script as user server with the corresponding ssh keys:


cd "/home/server/Downloads"
find . -type f | while IFS= read filename; do
case "${filename,,*}" in
*.part) : ;; # Excludes *.part files from being moved
*.resume) : ;;
*.torrent) : ;;
*.trashinfo) : ;; : ;;
# Include
*document*) scp "$filename" "imac@imac.local:/users/imac/Documents/" ;;
# Else
 *) echo "Don't know where to put $filename" ;;

Now I'm using transmission-daemon and the script is not executed as server anymore, therefore, scp does not work because when trying to ssh to imac@imac.local it prompts for a password (no ssh key for that user).

How can I fix this problem?

share|improve this question

If you have read access to "server" private ssh key, use the -i modifier with scp, that tells it to use a specific private key file.

BTW, isn't shorter to write this?

find /home/server/Downloads -type f -iname *document* -exec scp -i pathtokeyfile "{}" "imac@imac.local:/users/imac/Documents/" ;
share|improve this answer
Thanks, that did help. The problem is that transmission-daemon is not running the script as root. I logged the user with "echo "$USER" >> $LOG_FILE" and it returns an empty log file. If I run it as server or root it returns the corresponding user. – fedxc Nov 11 '11 at 1:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.