Skip to content
Advertisement

Tag: ssh

Can`t call command with variable on sh file using ssh

I have the script on centos 7 server for kill process by used id: Above script works fine when it is called from the server. But my goal calls this file using ssh from my local machine like: But I git this error: Answer you need to install lsof on the remote server. or try to add the full path

how to customize ssh log?

Goals of my ask: Implement a fail2ban which ban user. (For this I have a solution) Work environment: I connect to my machines with ssh-key protect with a password When a user type a wrong password for his ssh-key thrice I want to ban it for prevent attack Fail2ban parsed logs in /var/log/messages. Actually I have enable LogLevel DEBUG2 on

Preventing expansion/evaluation of parameter in ssh command

I have a shell script that runs a docker container on a remote server. I’m trying to send the hostname of the remote server into the container but i just get the hostname of my local computer where i run the script. The command looks like this in the script: Both hostname and the environment variable host.hostname becomes the name

find: missing argument to -exec with ssh

Trying to remove directories from server: I tried with ; and ;; and ; and “{}” and -exec sh -c ‘rm -r “{}”‘ ; All get’s the error find: missing argument to “-exec'” Thanks Answer Directly running commands with ssh is often hard to impossible when you want to use special characters. This is because ssh remotely calls sh -c

Losing stdout data in python

I’m trying to make a python script which is going run a bash script on a remote machine via ssh and then parse its output. The bash script outputs lot of data (like 5 megabytes of text / 50k lines) in stdout and here is a problem – I’m getting all the data only in ~10% cases. In other 90%

Advertisement