Changes

Linux Remote Shell Notes

710 bytes added, 17:01, 5 March 2018
The following lines were added (+) and removed (-):
== use SSH to execute a remote command ==You'll need to be able to ssh with automated password or enter the password each time you run the 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 EOFHere 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