I want to do a remote shell to a Linux system and run various commands eg to ps
and grep
for processes and kill them.
I assume I can do something like: rsh
that linux scripts do right?Is this the best option for me?
rsh
is unencrypted so isn't widely used anymore and is probably switched off on the remote systems you want to connect to.
It would be better to use SSH
. JSch is a open source pure Java library that will make SSH connections and run commands for you.
JSch是执行此类任务的不错选择。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.