As a word of caution, you should ensure that authentication between machines is one way. This means that you should access the server from your laptop, but you shouldn't allow the server to access the laptop in the same way. It may not be obvious here, but with larger networks, this security problem becomes more evident.
Why not mount the remote directories locally, and then ssh
into the machine (sshfs
, fuse
, fstab
)? Is it because the files on the laptop are updated, and those updated version are needed on the remote machine (rsync
)? After the server runs, are the files updated and you need to then bring those processed copies down? If you provided an example workflow, including the files, that information would be helpful to answer your question.
You say you want to be able to edit the files using local software, so you can set up sshfs
on your laptop to connect to the remote server, so long as you're okay with not editing the files while not having access to the server.
Another option is to use rsync
, which might be a better solution if the source of truth, or updated copies swap between the laptop and server. You would be able to sync them both, and tell rysnc
which system is the most up-to-date.
It sounds to me like you've just overthought this a bit, and instead of logging into the server and mounting your directories from the laptop, go ahead and mount those directories from the server to the laptop, and then ssh
into the system.
To make all of this easier, look into setting up .ssh/config
with PubKeyAuthentication
.