Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

There is a Linux server that I access via sshfs. Unfortunately, a pure ssh connection is not possible due to security concerns on that end.

If I access this server via sshfs, any commands that I execute, are sort of run through the local server, or something. Not sure how to describe it.

For example, if there is a tar file that contains 10,000 files in it on the remote server, if I untar this file, it takes a LONG time because it is (under the hood) essentially extracting each file to my local server and then copying it to the remote server. Where as, if I was physically on the remote server itself, the untarring would be lightning fast because all the work is done right there locally. I guess this is an inherent thing about how sshfs works.

What I'm trying to figure out, is a way to execute commands in a way that will run directly on the remote server or get the remote server to run the commands.

One thing I can think of is to create a cron job on the remote server so it will run (locally) whatever commands I give it. But this is pretty inconvenient. Another alternative is to run a PHP Shell type program (since the remote server is a web server). Any commands given via PHP Shell would run locally.

Are there bash commands that can be used to force the input commands to run directly on the remote server? I tried messing with nohup but I'm not sure that is helpful or not...

share|improve this question

2 Answers 2

The only way to do this is to have interactive access of some description on the remote server so the answer is no.

share|improve this answer

Quite sometime back, I have worked with servers in some ISP where I can access via ftp/sshfs etc, but no interactive shell access, to the server. One workaround they have is to allow you to set up a cron/at job via a web interface, or a copy of crontab file that you can edit, that will invoke scripts/commands. Ask the administrator if that is possible, if interactive shell absolutely cannot be granted.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.