-3

i did some mess and I'm trying to rescue some files from my ubuntu server to my local windows 7 client.

  1. Option WinSCP: Unfortunatelly WinSCP does not work anymore since I made the mess. (I run the following command: sudo chown -R ubuntu / So I changed the ownership of almost all files by mistake :-(. Seems as it has also an effect on connecting via WinSCP)

  2. Option pscp.exe: So I thought I could use pscp.exe but it seems to be challanging for a newbie like me. I'm permanently getting following error message: FATAL ERROR: Network error: Software caused connection abort. That's the command I'm using: pscp.exe -i "PATH TO PRIVATE KEY.ppk" -P 22 -pw PASSWORD ubuntu@XXX.XXX.XXX.XXX:/home/backup/volumes/grafana-202307282133.tar.gz C:\

Any suggestions what I also could try or where the problem is?

jjx
  • 9

2 Answers2

2

If you already changed owner of your home directory you might have no permission anymore to access your files. Since you might also have changed owner of /etc this can be source of trouble.

Your particular problem is (I guess!) that you changed owner of your /home/user/.ssh. Your pscp.exe command indicates you use key based authentication (good) but the ssh service (if it is still running at all) will not let you in anymore because the file ownership is messed up (bad for you).
WinSCP or pscp.exe make no real difference, they are more or less the same here.

What you could do (you have not mentioned if you have physical access to the server; that influence your options):

  1. If you still have a root shell on the server you might be able to copy stuff somewhere else. (with physical access you might be able to login as root directly)
  2. Run a Live Linux Image. Then you could mount the messed up filesystem and copy whatever you want.
1

if you did sudo chown -R ubuntu / on a Unix machine, then a reinstall is probably the easiest way to fix it.

As well as affecting normal access permissions, it will have hit a few executables that need to be owned by root (see suid for why).