1 |
ssh USER@HOST 'command' |
USER –> Usuario.
HOST –> Servidor.
Command –> Es el comando a ejecutar.
Ejemplo:
1 2 3 4 5 6 7 8 9 10 |
ssh lradmin@172.31.7.221 df Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda2 10473452 1599732 8873720 16% / devtmpfs 489456 0 489456 0% /dev tmpfs 507736 0 507736 0% /dev/shm tmpfs 507736 13000 494736 3% /run tmpfs 507736 0 507736 0% /sys/fs/cgroup tmpfs 101548 0 101548 0% /run/user/1000 tmpfs 101548 0 101548 0% /run/user/0 [root@rhel1 ~]# |
1 2 3 |
[root@rhel1 ~]# ssh lradmin@172.31.7.221 uptime 00:31:26 up 52 min, 2 users, load average: 0.00, 0.01, 0.04 [root@rhel1 ~]# |
Continuar leyendo «Como ejecutar comandos remotos en ssh y mostrarlos localmente»