Running a command line remotely

Associate
Joined
18 Oct 2002
Posts
1,830
Location
Southampton
i want to be able to run a simple command line on my main pc from any computer within my local network. has anyone got any idea on how to do this? ive had a few ideas but i did not get very far and google didnt provide anything useful.

thanks
 
PsExec should do the trick. Have a look at this :)

Sorry, just read that properly. PsExec should do the job, it allows you to remotely execute commands on another machine on the network. If that's not enough, you could enable the telnet service on the remote machine and connect to it that way. If security is an issue, try SSH.
 
Last edited:
Well the best way to do this is to run an SSH server. The dodgy way to do it is to spawn a root shell/reverse shell on your machine (which is basically a backdoor) then use something like netcat :p .
 
ive set up PsExec to work with a batch file on the "client" pc. surely if someone has PsExec on their pc then they can get into someone elses pc easily. i didnt have to do anything on the pc i wanted to control!!
 
I think the process is run on the remote machine using the credentials that you used to execute the PsExec command. Therefor, if you don't have sufficient access to the remote machine, it won't run.
 
ok, so as i was testing with my laptop which has the same username and password as my desktop everything worked. but if another user tried to do it then it would fail?

does that mean i will have to set up accounts on my pc to match other remote accounts which i want to allow to run this command?
 
Yes, you would need to setup accounts on the machine that you plan on executing processes on. But, you can specify a username and password when you run the PsExec command. I'm not too sure whether it works or not, I would have thought so though.

And to answer the first question, remote processes cannot be run without being authenticated on the remote machine. So, if the same account does not exist on both machines OR you don't specify valid credentials when running the command, the process would not be executed.
 
Back
Top Bottom