You need to check ownership and permissions for the files and folders involved. Your current user needs permissions to read /home/bitcoin/.bitcoin/new_wallet/wallet.dat
and permissions to write to the current directory for backup.dat
Try ls -ld /home/bitcoin/.bitcoin/new_wallet/wallet.dat .
and pwd
and id
. The permissions will be shown as three triplets for owner, group and others shown as rwxr-x--- 1 bitcoin pi
which means the owner (user "bitcoin") has read, write and execute permissions (rwx
), members of the group ("pi") have only read and execute permission (r-x
) and other people have no permissions at all (---
). The id
command will tell you which groups your current use is a member of. The pwd
will tell you the full name of the current directory where you are trying to write your backup.dat
To further diagnose the problem try
see if the target already exists and can't be overwritten
ls -l backup.dat
mv backup.dat backup.dat.old
echo test > backup.dat
see if the source file is readable - look for messages no read permission
file /home/bitcoin/.bitcoin/new_wallet/wallet.dat
try to copy it directly
cp /home/bitcoin/.bitcoin/new_wallet/wallet.dat backup.dat