All Questions
3,007
questions
2
votes
3
answers
70
views
Using sed to remove differences in two arrays (updated ssh keys)
My aim is to updated automate the update of ssh keys in the authorized_keys file. Due to restrictions i am unable to use ansible which would have been a lot simpler.
Steps:
read keys from the file
...
0
votes
0
answers
25
views
ssh into remote servers, get systeminfo and print out in local terminal [duplicate]
I have the following script and when I run it, I don't get the expected output to the local terminal.
I am assuming it must be the variables that I am assigning in the heredoc that is not getting ...
0
votes
1
answer
32
views
Bash command substitution issues
I'm writing a Python script to parse various logs across different hosts.
I can successfully run bash scripts via Python's subprocess module, however, I want to minimize the number of ssh calls, so I'...
1
vote
0
answers
23
views
A call of ssh breaks i/o-redirection in a bash-script [duplicate]
Given the script
$ cat save_stdin.sh
#!/bin/bash
# save stdin
exec 3<&0
echo " intermediate output independing from stdin:"
echo "This is a test " | grep "test" ...
0
votes
1
answer
54
views
Use remote variables in local bash script via SSH
I am trying to process a bash script on a local machine but where some of the variables are needed from a remote machine (on the same LAN) via SSH. Here's where I've go to s far, but it is getting ...
0
votes
0
answers
48
views
How do i use nohup command for execute N processess in background on a server?
I'm using the command on a server for execute in background some processess:
nohup bash batch > logfile.txt 2>&1 <&- &
but when i close my ssh session, the process batch is ...
0
votes
1
answer
39
views
connect_to localhost error while testing remote SSH connection with netcat from bash script
I'm writing a bash script that needs to maintain a SSH connection (SSH tunnel) to a remote host alive. I am checking whether connection on the remote IP exists with netcat -z, and if it doesn't, then ...
1
vote
1
answer
82
views
Using GIT_SSH_COMMAND to switch SSH key based on current working directory
I have two Github accounts (work + personal), both with their own SSH keys (key_work & key_personal)
Projects live in:
~/git/work
~/git/personal
I'm trying to set the GIT_SSH_COMMAND up as an ...
1
vote
3
answers
103
views
Transfer file via ssh with only echo and cat command
Due to some constraints, i have to transfer local file to remote ssh with only echo and cat command and here-document.
I've tried:
#!/bin/bash
SSH_CMD=xxx # suppose `SSH_CMD` is my ssh command
w="...
0
votes
0
answers
36
views
HPC remote server side rsync command limit
I am currently trying to transfer three different files (that have multiple versions) to directories on a computing cluster via SSH using the rsync command. Two of these files exist in the same local ...
0
votes
0
answers
23
views
Writing a bash script to wait for a process on a remote machine to finish [duplicate]
I'm writing a script to automate some tasks, one of the steps is to wait for a process started on a remote machine to finish execution.
My idea is to show a spinner while the process keeps executing, ...
0
votes
0
answers
25
views
bash: grep latest file in a directory over ssh [duplicate]
I have a code where I can grep a very specific file over ssh:
ssh ${username}@${host} << -EOF
grep -n ${text} ${filename}
EOF
which will output the desired text. However, now I want to do the ...
0
votes
0
answers
45
views
sqlplus request on multiple servers
I can't seem to be able to write my script correctly.
problem is I don't realy understand how pipes or bash work yet.
I have a script to execute on multiple servers an get the result of each back to ...
-1
votes
1
answer
418
views
sudo systemctl daemon-reload not working through ssh command [closed]
After modifying systemctl myService.service file, when command "sudo systemctl daemon-reload" is executed remotely via SSH through a bash sh script:
The myService.service file is modified ...
0
votes
2
answers
40
views
How can I add a condition to my inline bash script to send an string using expect when that condition is met?
I'm using an inline script to connect to my servers, sometimes server is new and I have to type in a "YES" for the fingerprint to added, but most of my servers are old and I have connected ...