All Questions
678
questions
0
votes
0
answers
62
views
How to pass a for loop commandline argument to kubectl exec shell when run over ssh
I am executing the following commands over ssh and then past it to kubectl exec.
ssh -i 'path\to\file' user@host 'kubectl exec -i pod-name -- bash -c "du --max-depth=1 /home -h -t 10M | sort -hr &...
1
vote
1
answer
45
views
SSH from A through B to C, using private key on B
Schematic:
ssh ssh
A ------> B ------> C
^ ^
using A's using B's
ssh key ssh key
Preconditions:
A is running ssh-agent
A can access B
B can access C
A can't ...
1
vote
1
answer
38
views
ssh -t host1 ssh host2 "cat < /tmp/test.txt" – file not found
I'm trying to run cat < /tmp/test.txt on remote host host2 through host1. The file /tmp/test.txt exists on host2. I try:
# locally
ssh -t host1 ssh host2 "cat < /tmp/test.txt"
The ...
0
votes
1
answer
71
views
How to transfer a file to a remote host using parallel + ssh?
I am writing scripts to poll a large number of remote hosts over ssh using gnu parallel. I copy the script to them, run it and get the results. Right now I'm using two bundles parallel + scp to ...
1
vote
1
answer
54
views
git - using gitconfig to switch repository host address
So right now I have some alias in my ~/.ssh/config:
Host github_company_a
HostName github.com
Host github_company_b
HostName github.com
and I use the alias directly: git clone git@...
0
votes
1
answer
75
views
I'm getting on gitbash a warning WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! for github
When I try to clone a git repository in gitbash on Windows I get following error:
$ ssh -T [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST ...
0
votes
0
answers
35
views
Set terminal color without having bash history look wrong? [duplicate]
A site suggested I wrote the below to set the color of my terminal in `~/.bashrc
export PS1=`printf "\033[32m$ \033[39m"`
If I log in through ssh, press up, home, up text will be garbled.
...
1
vote
0
answers
31
views
How to make a script to launch different scripts in different workspaces in linux?
I have limited access to a linux machine, meaning I cannot install any external tools. I want to make a script to open terminals with ssh at different workspaces. However, I found that one way to move ...
0
votes
1
answer
40
views
pipefail over ssh in linux
set -o pipefail is not getting evaluated correctly on the remote host if the set command is used in ssh command.
Example
ssh hostname "set -o pipefail; false | true; echo $?" - gives 0 (Not ...
0
votes
0
answers
292
views
Permission denied error when trying to SSH through a script
I have a set of Bash scripts designed to establish an SSH connection from a local machine to a remote server through a middle server. The local script initiates a tunnel using socat, and the middle ...
1
vote
1
answer
907
views
How to pass bash's $@ over ssh accounting for spaces in arguments?
I want to read logs conveniently from my server. I'm trying to write a script that reads output of journalctl from my server, applying the parameters I pass to the script to journalctl call. I may ...
1
vote
1
answer
253
views
CentOS 9 Stream SSH with PuTTy - multiline commands
I've been using CentOS versions 6, 7 and 8 for a long time. Finally, I started using CentOS 9 Stream version. It doesn't matter whether GNOME desktop version or server version (black screen), I ...
0
votes
0
answers
125
views
I can't connect from Mac when I change the default shell to bash on Windows 11 SSH
I started an OpenSSH server on Windows and connected from a Mac terminal.
I was able to connect when the default shell was cmd.exe, PowerShell, or GitBash, but not when I changed to bash.
New-...
3
votes
1
answer
119
views
Why can I ssh and return a result faster than Linux can with a bundled command?
I'm writing a short bash script that involves logging into roughly 100 nodes and counting the number of processes running in top with my username, and I'm trying to combine the ssh-related processes ...
1
vote
1
answer
1k
views
How do I create a shell script that will exit the ssh session after executing the remote commands
I'm trying to write a bash script to compile and deploy some code to a remote server. So far I have been struggling to figure out how to get the script to exit the ssh session. I thought I could just ...