Need solution for my bash script executed localy for ssh remote machine [SOLVE]
Dear members,
I'm having some difficulties to find a solution to my problem. I have passed over 2 days in internet to find something, but nothing is working. Maybe it's simply not possible, but before giving up I would like to ask here. Thanks in advance,
The aim of this script is to ask to an admin on the local machine the IP address of the remote machine that will be configured, stock the IP in a variable and then automatically connect via ssh and execute the script that will change the hostname of the remote machine. I know that the way I m trying to do cannot work because the variable are not are not send over ssh.
Do you have idea about how I can do this ? I insist that I really want to do it in that way, because I know there is some more easier way to do but I want to solve it in the form for my own knowleadge purpose.
Sorry for my approxative english.
Last edited by Azura1003; 04-23-2020 at 10:50 AM..
I am trying to search and remove files from a list of servers. I want to find every occurence of this file on each machine and then remove it. If I execute the find command on the remote machine I would like to be able to pipe the output to xargs and remove the file. Does anyone know hat would be... (1 Reply)
Hi All,
i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine .
i tried with this code but it is doing in machine x only . and i need to exit from Y when... (1 Reply)
Hello to all
Background info:
Local machine : Linux, /bin/bash
Remote machine (for the user used for ssh) : SunOs, /bin/ksh
(so we have different OS, different Shells)
My problem :
From the local host i execute
$ var=bla
$ result=$(ssh -q user@remote-machine "
> echo \"this is... (12 Replies)
how to use ssh to run shell script on a remote machine?
ssh user@remote sh ./script.unx
i ran the above command
./script.unx HAS NOHUP COMMAND IN ITS BODY, I AM GETTING ERROR AS NOHUP NOT FOUND...
i tried to run that script from remote server, its working fine
do ineed to set... (6 Replies)
Hello,
I am running into few issues, please suggest me what I am missing.
I am running this script on a linux host.
Main idea of this script is to, login to each host via ssh and get uid of user, service user that I trying to run this script, has already deployed ssh keys and provide sudo... (8 Replies)
Hi,
I'm trying to automate a couple of mounts. (I would do this in fstab, but the auto feature causes the virtual machine I'm running in to freeze when it boots up) If the machine I'm trying to connect to is OFF, I get the host unreachable error and then the bash script stops. The problem is... (3 Replies)
I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99
Source Destination was UP, with IP 192.168.1.15.
This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
How to execute a script in remote machine through ssh
I have a script test.sh which does some backup activity in remote machine. Wanted to keep backup also in remote machine.
ssh -l username <remote machine> "commands to be exceuted as ; separted"
but how to put the script in the place of... (5 Replies)
Geeks,
Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s).
Here's the complete... (5 Replies)
Hi,
My goal is to connect from unix server A to windows server B and call a bat file on windows.
I am able to succeed in remoting to windows and executing a command, the issue i am facing is the shell scrip is exiting without making sure of bat file success.
Can you please help me in... (4 Replies)