Skip to main content

All Questions

Tagged with
2 votes
1 answer
183 views

Using Here-Document as password Input for ssh

First, I do know this is a security risk. I do know about ssh keys and sshpass. This belongs to a fun project. I wondered if a bash Here-Document could be used as a password input for ssh. I ...
Simon Huenecke's user avatar
2 votes
1 answer
150 views

Redirect multiple Bash code files to SSH with Escaping (same SSH session)

Need to redirect 3 bash code files (possibly more in the future) to SSH, escaping them (within the same SSH session) to execute them on remote host. Perfectly fine to list bash code files manually. ...
strider's user avatar
  • 43
0 votes
0 answers
65 views

How Do SSH-Launched Long-Running Background Jobs Detach Without nohup or disown?

When running a long-running command in the background over SSH from a non-interactive shell script, I noticed the process continues running on the remote machine without using nohup, disown, or ...
phip1611's user avatar
  • 101
0 votes
1 answer
52 views

Commenting out a line item in a text file that my bash .sh file refers to

I have an ssh .sh bash script file i'm running on a cron to check website status. The bash script (when ran) refers to a local txt file for a list of websites to check if they're down or up. ...
sven30's user avatar
  • 103
6 votes
5 answers
2k views

Download a file with SSH/SCP, tar it inline and pipe it to openssl

I want to download a list of files from a SSH server, then put it in some kind of container (like a tar file) and finally encrypt it (e.g. with openssl). The point of putting it into a archive is to ...
Xali's user avatar
  • 61
0 votes
1 answer
105 views

Return multi-line ssh output to separate variables?

RHEL 8.10 OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 As expected, this line (with two embedded commands) returns two rows: $ ssh -q remoteserver "ls -1 /proc/${p}/fd | wc -l ; ps -Ostate -p$...
RonJohn's user avatar
  • 1,184
9 votes
1 answer
600 views

Why is bash startup executed under non-interactive ssh

I see an unexplained difference in behavior with ssh on Linux and FreeBSD, and it is the FreeBSD behavior that I would expect from the plain language of the manpages. So, something extra happens on ...
q.undertow's user avatar
0 votes
1 answer
51 views

How to Load Personal .bash_rc for SU User via Direct SSH command

Problem Multiple engineers are using same machine with same loginuser and history gets loaded with others' people commands. Update: People login via private ssh keys (pub added/removed via trustedhosr)...
Vladimir Djuricic's user avatar
1 vote
0 answers
19 views

While Loop Exits After Calling Function [duplicate]

I'm trying to do a db backup script using Bash. When adding a "Resume" feature to the script, I do the following loop calling defined functions to do step by step (depending on the .lock ...
James's user avatar
  • 111
1 vote
2 answers
334 views

How to make ssh return immediately after running background job

When I run on linux-system/bash: sleep 10 & I get bash prompt immediately. But when I run: ssh linux-system 'sleep 10 &' I wait 10 seconds. Two questions: Can I find explanation in ssh/bash ...
Philippe's user avatar
  • 1,505
0 votes
0 answers
26 views

Ghost string in terminal, string doesn't go away when using backspace [duplicate]

Linux shell problem on a server, bash 5.1.4(1)-release. Debian 11.10. I have this on my command line right now after pressing the up arrow: server# ctr plugins listkubeadm init --pod-network-cidr=10....
AttributedTensorField's user avatar
0 votes
1 answer
238 views

X11 DISPLAY Configuration for SSH and Nvidia Optimus Graphics

There are one Intel integrated graphics and the other Nvidia graphics card in my remote box, where OpenSSH and X11 servers run on Ubuntu Desktop 24.04. The graphics drivers and utils are installed ...
sof's user avatar
  • 101
-2 votes
1 answer
233 views

How do I get lastlog timestamps in a generic format?

I have multiple Ubuntu machines in different locations. I want to collect the last login information from these machines. However, when I use the lastlog command, it returns dates in different formats....
Cong Thanh Huynh's user avatar
0 votes
1 answer
73 views

Is there a way to run a custom setup script on a shared ssh login, but only for me?

I share an ssh login with my colleagues. Although generally fine people, they have certain flaws - for example a preference for emacs-style bash editing, their own (incorrect) alias preferences, etc. ...
Mark W's user avatar
  • 145
5 votes
3 answers
320 views

Setting PS1 with site-wide configuration

I've had problems with people logging into some servers via ssh and forgetting that a specific terminal is no longer local. Today someone tried to shutdown their laptop with sudo shutdown -h now, and ...
Stewart's user avatar
  • 15.4k

15 30 50 per page
1
2 3 4 5
47