Skip to main content

All Questions

Tagged with
1 vote
0 answers
50 views

SSH authentication

I am trying to make ssh on VM have an authentication before the user is connected to the session. Right now I have an Azure MFA app, that when the user authenticates, it shows a password. I want this ...
Tavleen Aneja's user avatar
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 ...
Judith5230's user avatar
2 votes
1 answer
382 views

SSH session termination on script error when sourcing multiple sub-scripts

I'm facing an issue with SSH on a server. Running individual scripts (source s01.sh, etc.) works fine, with errors displayed in the console. However, when using a master script to source these scripts,...
jay.sf's user avatar
  • 237
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 ...
Ben Whitely's user avatar
0 votes
0 answers
69 views

I can't concatenate ssh to a server from another server

I want to get the last folders name from a pi and this commands works just fine: ssh [email protected] 'ls -t /media/usb/Pictures/new/ | head -1' Returns: 230125_1356 To retrieve the number of files in ...
Mark's user avatar
  • 1
0 votes
0 answers
32 views

scp returns No such file or directory in script but executes when run manually [duplicate]

For context, I need to use a custom command to build an identity file so I can ssh successfully. I've renamed it because it's an internal tool and want to avoid NDA issues. You can consider it as a ...
HappyCoder's user avatar
0 votes
0 answers
299 views

How about add passphrase into .bashrc

I added a script in my .bashrc to start ssh agent, but the passphrase is asked directly after logging, so I need to have my long password with me, is it possible to adding into the script and run it ...
James78's user avatar
  • 189
0 votes
0 answers
39 views

How to make a Shell Script behave as if it were a Real User

My goal is to ssh to a server called gateway, and then from there ssh to a server called meerkat. Once I am in meerkat I want to run a script that copies files from a directory in the server to my ...
Jacob Waters's user avatar
6 votes
1 answer
8k views

How to abort if ssh control socket already exists?

I'm using the following line in my scripts: ssh -f -N -M -S <control socket> <host> This means the initial connection just stays in the background and I can use it for subsequent calls to ...
finefoot's user avatar
  • 3,504
0 votes
1 answer
274 views

I need to ssh into another machine using expect and a password and start a program there, then start a program on my local machine. How can I do this?

As said in the title, I am writing a script that should run on Computer A. Computer A should ssh on Computer B, run Program B, then exit the ssh session (Program B still running on Computer B) and ...
DearJohn's user avatar
1 vote
1 answer
1k views

Automatically Run Multiple Command over SSH on multiple devices

I have 100+ devices that has same username and password and enabled SSH. What I would like to achieve is for each device I want to run same command to change their password bulk. What I did is to ...
Pelin Canikli's user avatar
1 vote
1 answer
2k views

Run scripts at logout

Sometimes I ssh into a box, and run some script that makes a change to the system. I want to undo this change when my session ends, either explicitly (e.g., via exit from the logout shell) or ...
BeeOnRope's user avatar
  • 559
0 votes
1 answer
944 views

Execute a remote bash script locally

I've seen that it's possible to run scripts stored locally on a remote server eg.: run a command: ssh USER@HOST 'COMMAND' run a script ssh [email protected] 'bash -s' < script.sh What about doing ...
lese's user avatar
  • 2,756
0 votes
3 answers
6k views

Variable for SCP command in script

I'm trying to write a script that will check what is the last modified/created file on the server, then copy it to my homedirectory on this server and then copy this file from node to my local machine....
Grimorth's user avatar
-1 votes
3 answers
349 views

Notification email when someone SSH Linux Centos7 workstation (output of the command who)

My Linux workstation is part of a shared Network. I would like to receive a notification email every time someone SSH my workstation. For that purpose, I opened the file ~/.bash_profile in gedit (my ~/...
user avatar

15 30 50 per page