I have a use case where my folder on the linux server needs to have its permissions opened up so I can use a sudo account to move files from my folder to shared folders. What then happens is often times I am not the one to log out (ssh connection disconnects) and my home folder permissions stay open. I don't care about the permissions being open except for the fact that when I try to ssh back in, the open folder permissions prevent my key authentication from working and I'm forced to enter a password.
I want to know if I can setup a way to always set my permissions to 700 upon exiting (graceful or otherwise) the ssh session. Alternatively, if there is a way to make key authentication work when my home folder is set to 777 that would also help.
By the way, in case it's helpful, here is what I'm actually trying to do. I use
scp to move a locally built
.jar from my machine to the home folder on the linux server. I then have to move that
.jar from my home folder to a shared folder where the
.jar can be executed. To move that
.jar to the shared folder I have to use a provided
sudo account, however, that
sudo account cannot access my home folder unless I open the permissions.