All Questions
109 questions
1
vote
1
answer
100
views
How to display text for non-interactive login shell
What I need:
I am trying to change /etc/bashrc in such a way that shell could display specific text when the following ssh command is entered
ssh user@ip "whoami"
But I don't understand ...
1
vote
2
answers
165
views
Multiple ssh sessions with different users
I am writing a script that connects to multiple servers which uses 3 different users.
#!/bin/ksh
server1=("abc1" "abc2")
server2=("abc3" "abc4")
server3=("...
4
votes
3
answers
552
views
Two ssh output as awk input
I have two remote servers that I am trying to ssh and cat some files.. I want to input the output of the ssh to a awk command.
This is what I have got
ssh username@host1 “cat /tmp/test/*” ssh ...
3
votes
1
answer
153
views
How to ensure that SSH client leave stdout file descriptor clean for reuse?
This code terminates with error :
(
ssh localhost seq 100000
seq 100000
) | wc
#-> seq: write error: Resource temporarily unavailable
This is a minimal code to reproduce the write error.
...
0
votes
1
answer
198
views
How to interrupt a running command in linux and continue from the last state later?
I run a sh script on terminal of linux remote server using ssh which will take very long. I need to power off my machine and I want to save the current state of execution and continue later from the ...
2
votes
2
answers
585
views
Replace $'\374', $'\344' and more with appropriate umlauts
after 2 days of research, I must ask the pros over here.
I had set up a NFS-share on my first Debian server at home. I copied over a few files from a windows 11 machine and now all the umlauts are ...
0
votes
1
answer
336
views
How to use alias command with a paramiko SSHClient connection?
I am trying to execute the following, with no success getting either the 'py3start' or the 'py3test' alias commands recognized - (I introduced the 'py3test' for testing purposes to check if setting ...
0
votes
1
answer
1k
views
ssh EOF in bash script - how to store value of command?
I need to basically copy only the last created folder in a directory of many folders within an SSH session. I have the correct find command to do this, but I just can't seem to store the result within ...
0
votes
0
answers
2k
views
sshpass No such file or directory
need add string to file on remote ssh server without prompting sudo password
myuser=testuser
$ sshpass -p "$mypass" ssh -t -o StrictHostKeycheking=no $myuser@$myhost "echo $mypass | ...
0
votes
1
answer
475
views
How to copy files to sourceforge in non-interactive request for password?
I want to automate the copying of files to Sourceforge with GitHub Actions.
I get problems when I copy files in non-interactive mode. For eg:
scp <file on laptop> <folder in sourceforge host&...
1
vote
1
answer
5k
views
ssh to execute remote command under interactive shell
Very similar with Run a command in an interactive shell with ssh after sourcing .bashrc, yet the answer there doesn't work for me.
I want to to execute remote command via ssh under the full ...
0
votes
1
answer
1k
views
Variable expansion with sh -c executed over ssh
I'm trying to execute an command via sh -c over SSH in an LXC container. Since lxc-attach is involved I have to use sh -c like this: ssh <host> "lxc-attach -- sh -c \"<command>;&...
-1
votes
2
answers
504
views
How to use pipe with "sudo -ui"?
I have this command
cat ~/.ssh/id_dsa.pub | ssh root@[my_server] "cat >> ~/.ssh/authorized_keys"
How can I do the same thing but with sudo -iu user1 before the 2nd cat? That is, I ...
0
votes
1
answer
6k
views
Piping the results from an SSH command to be saved locally [duplicate]
I've the following command in a script that I want to run that will happily output the result of all the remote commands to STDOUT on the console.
ssh -t my-server1.my-domain.net << EOF
./...
0
votes
1
answer
220
views
how get ssh awk remote values
im using this script
[test@sys-master ~]$ parallel -k -j 100 sshpass -p test1213'!' ssh -oStrictHostKeyChecking=no -oCheckHostIP=no -q [email protected].{} "cat /proc/loadavg | awk -F \" \" '{...