Uploading files remotely just deletes the contents

1

1

I'm new to Linux, and for school I'm using a remote SSH shell via SSH Secure Shell Client 3.2.9 and SSH Secure File Transfer Client from Windows 7 to try to upload files.

We were going over the chmod command and I ended up setting my entire $HOME directory to rwx (777). Now, I cannot upload any file remotely (haven't tried at school): It uploads the file but deletes all content and displays 0 Bytes. Also, I can create a file...but if I concatenate or try to add anything to it, the command line acts like it processes it, but the file is still 0 Bytes.

I'm not sure what I've done exactly and how to fix it. I believe in trying to fix it I also went below my $HOME into the directory that holds all our schools csusers and set my directory there to like 755 or something.

I'll probably have to go talk to my professor, but I just wanted to try to fix it.

user2958615

Posted 2013-11-14T11:23:06.670

Reputation: 111

1you will probably have to consult your schools technical staff. nothing about the chmod change you made should cause you to loose the ability to write files. quite the opposite in fact. – Frank Thomas – 2013-11-14T13:57:15.743

@FrankThomas agreed, +1. You might be wrong though, if the OP ran chmod -R, that would have changed the permissions of ~/.ssh/id_rsa and related files which would probably screw with ssh connectivity. I seem to recall that ssh does not like those files to be world readable. – terdon – 2013-11-14T15:02:54.500

COuld you show us a specific example? Say you i) ssh user@server, then ii) echo "foo" > bar and then iii) cat bar. What happens? – terdon – 2013-11-14T15:04:06.127

When I do this, the exact thing I am describing happens. The file is created, but there is not content. After running the above commands, and running ls -l on the file. It reads: -rw------- 1 'name' group 0 Nov 14 10:36 bar The -rw- is what bothers me, I think I have my mask set to 0022. Also, even after setting different permissions, I still cannot add content to the file. – user2958615 – 2013-11-14T16:37:45.117

No answers