Changes

Linux Remote Shell Notes

612 bytes removed, 21:28, 24 July 2020
/* use SSH to execute a remote command */
The following lines were added (+) and removed (-):
You'll need to be able to ssh with automated password or enter the password each time you run the command.{{:Secure Shell - use SSH to execute a remote command}} Execute a remote command on a host over SSH: ssh nicolep@192.168.100.10 'reboot'The example above will reboot the remote computer. Multiple commands ssh nicolep@192.168.100.10 'uptime; df -h' Show the kernel version, number of CPUs and the total RAM: ssh root@192.168.100.10 << EOF uname -a lscpu  | grep "^CPU(s)" grep -i memtotal /proc/meminfo EOF Here is how Nicole can execute her script on the remote computer ssh nicolep@192.168.100.10 'bash -s' < nicolejob.shNicole's script is local on her machine, and she executed it on the remote host.
Bureaucrat, administrator
16,192
edits