View previous topic :: View next topic |
Author |
Message |
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Thu Dec 06, 2012 10:57 am Post subject: rshd + inetd = lightest way to execute commands remotely? |
|
|
Is rshd+inetd the lightest choice for executing commands on a different system? I'm trying to save every CPU cycle I can with this project. I'm not concerned about security because the system running rshd+inetd will be connected via ethernet directly to a trusted system.
Last edited by grant123 on Thu Dec 06, 2012 11:28 am; edited 2 times in total |
|
Back to top |
|
|
truc Advocate
Joined: 25 Jul 2005 Posts: 3199
|
Posted: Thu Dec 06, 2012 2:32 pm Post subject: |
|
|
Code: | nc6 -l -p 9999 -e /bin/sh | (on the server side)
This is probably lighter and less secure!
(nc6 or nc is from the netcat6 package) _________________ The End of the Internet! |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Thu Dec 06, 2012 9:33 pm Post subject: |
|
|
Wow, I wish I would have asked before I spent all day on rshd+inetd.
I'm playing with nc6 and it's incredibly easy to get working, but I can't find a way to use it like rsh where the client can just issue a single command. The client stays open after the commend has been issued. Is there a way to get the client to issue a single command to the server and then terminate like rsh? |
|
Back to top |
|
|
truc Advocate
Joined: 25 Jul 2005 Posts: 3199
|
Posted: Thu Dec 06, 2012 10:43 pm Post subject: |
|
|
Actually, I was almost sure this wasn't what you were looking for! Since, I was wrong, and since you're trying to save every CPU cycle you can, you can even do it in udp! Should be even faster and definitely lighter!
As for the the client which does not terminate, did you try the --send-only option:
Code: | echo ls -l /tmp | nc -u --send-only ::1 9999 |
_________________ The End of the Internet! |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Thu Dec 06, 2012 11:23 pm Post subject: |
|
|
--send-only makes the client terminate but it would be nice to receive data back from the server before termination. Is that outside of nc6's abilities? |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Thu Dec 06, 2012 11:39 pm Post subject: |
|
|
I also noticed that when using UDP, nc6 spawns about 8 or so processes after the first connection from the client. Have you seen that behavior? |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Fri Dec 07, 2012 9:35 pm Post subject: |
|
|
Thanks a lot for your help truc! |
|
Back to top |
|
|
truc Advocate
Joined: 25 Jul 2005 Posts: 3199
|
Posted: Fri Dec 07, 2012 10:40 pm Post subject: |
|
|
grant123 wrote: | I also noticed that when using UDP, nc6 spawns about 8 or so processes after the first connection from the client. Have you seen that behavior? |
I've just tested, and it doesn't seem to happen here, weird, what are the processes? here is how I monitored the process: Code: | watch -n 1 pgrep -fl ^nc |
What do you have? _________________ The End of the Internet! |
|
Back to top |
|
|
|