Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rshd + inetd = lightest way to execute commands remotely?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Thu Dec 06, 2012 10:57 am    Post subject: rshd + inetd = lightest way to execute commands remotely? Reply with quote

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
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Dec 06, 2012 2:32 pm    Post subject: Reply with quote

Code:
nc6 -l -p 9999 -e /bin/sh
(on the server side)

This is probably lighter and less secure! :lol:
(nc6 or nc is from the netcat6 package)
_________________
The End of the Internet!
Back to top
View user's profile Send private message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Thu Dec 06, 2012 9:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Dec 06, 2012 10:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Thu Dec 06, 2012 11:23 pm    Post subject: Reply with quote

--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
View user's profile Send private message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Thu Dec 06, 2012 11:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
grant123
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1080

PostPosted: Fri Dec 07, 2012 9:35 pm    Post subject: Reply with quote

Thanks a lot for your help truc!
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Dec 07, 2012 10:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum