Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-08 Thread Greg Wooledge
On Wed, Feb 08, 2023 at 04:03:04PM +0100, to...@tuxteam.de wrote: > On Wed, Feb 08, 2023 at 09:31:00AM -0500, Stefan Monnier wrote: > > >> $ cat opt/bin/hibernate.sh > > >> mate-screensaver-command -l # Activates screensaver and locks > > >> the screen > > >>

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-08 Thread tomas
On Wed, Feb 08, 2023 at 09:31:00AM -0500, Stefan Monnier wrote: > >> $ cat opt/bin/hibernate.sh > >> mate-screensaver-command -l# Activates screensaver and locks > >> the screen > >> sudo systemctl hybrid-sleep# Hibernate and suspend the system. Thi

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-08 Thread Stefan Monnier
>> $ cat opt/bin/hibernate.sh >> mate-screensaver-command -l # Activates screensaver and locks >> the screen >> sudo systemctl hybrid-sleep # Hibernate and suspend the system. This >> will trigger activation of >>

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-08 Thread Greg Wooledge
On Wed, Feb 08, 2023 at 12:00:13PM +, Ottavio Caruso wrote: > $ cat opt/bin/hibernate.sh > mate-screensaver-command -l # Activates screensaver and locks > the screen > sudo systemctl hybrid-sleep # Hibernate and suspend the system. This >

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-07 Thread tomas
On Tue, Feb 07, 2023 at 10:12:10AM -0600, David Wright wrote: [...] > Have you tried typing these two characters into your frozen ssh: > > ~ . > > Just those two, at the start of the line (that's important). That's really important. So if you don't know, type first ENTER, then you are at the s

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-07 Thread Greg Wooledge
On Tue, Feb 07, 2023 at 10:12:10AM -0600, David Wright wrote: > Have you tried typing these two characters into your frozen ssh: > > ~ . > > Just those two, at the start of the line (that's important). That's why I documented it as three characters -- Enter, Tilde, Period. It's slightly less con

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-07 Thread David Wright
On Tue 07 Feb 2023 at 10:30:22 (+), Ottavio Caruso wrote: > Am 06/02/2023 um 22:43 schrieb Greg Wooledge: > > Seems pretty obvious to me. It was a false claim all along. > > How do you get to that statement? To show it wasn't a false claim, you have to demonstrate that $ ssh LAP2 hibernat

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-07 Thread Greg Wooledge
On Tue, Feb 07, 2023 at 02:20:25PM +, Ottavio Caruso wrote: > Am 07/02/2023 um 12:12 schrieb Greg Wooledge: > > On Tue, Feb 07, 2023 at 10:30:22AM +, Ottavio Caruso wrote: > > > The reason I cannot just ssh into LAP2 and then run hibernate.sh from the > > > shell is because, if I do, I get

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-07 Thread Greg Wooledge
On Tue, Feb 07, 2023 at 10:30:22AM +, Ottavio Caruso wrote: > The reason I cannot just ssh into LAP2 and then run hibernate.sh from the > shell is because, if I do, I get a dangling zombie ssh shell that freezes my > LAP1. https://mywiki.wooledge.org/BashFAQ/063

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-06 Thread Greg Wooledge
On Mon, Feb 06, 2023 at 04:37:50PM -0600, David Wright wrote: > On Mon 06 Feb 2023 at 19:54:20 (+), Ottavio Caruso wrote: > > Am 06/02/2023 um 19:05 schrieb Greg Wooledge: > > > ssh LAP2 'type hibernate.sh; echo "$PATH"' > > > > _Touché !_ You nailed it: > > > > > > $ ssh LAP2 'type hibernat

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-06 Thread David Wright
On Mon 06 Feb 2023 at 19:54:20 (+), Ottavio Caruso wrote: > Am 06/02/2023 um 19:05 schrieb Greg Wooledge: > > ssh LAP2 'type hibernate.sh; echo "$PATH"' > > _Touché !_ You nailed it: > > > $ ssh LAP2 'type hibernate.sh; echo "$PATH"' > bash: line 1: type: hibernate.sh: not found > /usr/local

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-06 Thread Nicolas George
Greg Wooledge (12023-02-06): > On most Linux systems, including Debian, bash is built with a compile-time > option that makes it try to determine whether it's a child of sshd. If > it believes itself to be that, it will source ~/.bashrc even though it's > not an interactive shell. Oh! My day of n

Re: SOLVED Re: Cannot rum multiple command on remote machine via SSH

2023-02-06 Thread Greg Wooledge
On Mon, Feb 06, 2023 at 07:54:20PM +, Ottavio Caruso wrote: > Am 06/02/2023 um 19:05 schrieb Greg Wooledge: > > ssh LAP2 'type hibernate.sh; echo "$PATH"' > > _Touché !_ You nailed it: > > > $ ssh LAP2 'type hibernate.sh; echo "$PATH"' > bash: line 1: type: hibernate.sh: not found > /usr/loc

Re: Cannot rum multiple command on remote machine via SSH

2023-02-06 Thread Greg Wooledge
On Mon, Feb 06, 2023 at 06:59:33PM +, Ottavio Caruso wrote: > LAP1:~$ ssh LAP2 sudo tlp setcharge 90 95 BAT1 > Setting temporary charge thresholds for BAT1: > stop = 95 > start = 90 > LAP1:~$ ssh LAP2 ls > Desktop > docs > Documents > Downloads > git > opt > storage > test > test2 > LAP1

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Keith Bainbridge
On 4 February 2023 11:26:18 pm UTC, Charles Curley wrote: >>On Sat, 4 Feb 2023 11:24:37 + >>Ottavio Caruso wrote: >> >>> At night, I want to connect to LAP2 and perform these commands: >>> >>> $ sudo tlp setcharge 90 95 BAT1 # resets battery settings for >>> external battery >>> >>> $ hibe

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Charles Curley
On Sat, 4 Feb 2023 11:24:37 + Ottavio Caruso wrote: > At night, I want to connect to LAP2 and perform these commands: > > $ sudo tlp setcharge 90 95 BAT1 # resets battery settings for > external battery > > $ hibernate.sh # a script that performs some housekeeping, puts > laptop into hibern

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Will Mengarini
* Greg Wooledge [23-02/04=Sa 10:15 -0500]: > Is LAP2 a Debian system, or something else? OP said LAP2 is Debian stable.

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Greg Wooledge
On Sat, Feb 04, 2023 at 07:40:33PM +0100, Kamil Jońca wrote: > Ottavio Caruso writes: > > [...] > >> > > > > No, this is not good. The "hibernate.sh" must be run as standard user. > > Oh. I overlooked that. Sorry. It wasn't just you. It was entirely unclear that the second command was meant

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Kamil Jońca
Ottavio Caruso writes: [...] >> > > No, this is not good. The "hibernate.sh" must be run as standard user. Oh. I overlooked that. Sorry. KJ -- http://stopstopnop.pl/stop_stopnop.pl_o_nas.html

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Greg Wooledge
On Sat, Feb 04, 2023 at 02:13:54PM +, Ottavio Caruso wrote: > > > $ ssh LAP2 hibernate.sh # it works too > > > $ ssh LAP2 "sudo tlp setcharge 90 95 BAT1 ; hibernate.sh" > > > > > > return: > > > > > > hibernate.sh: command not found > No, this is not good. The "hibernate.sh" must be run as

Re: Cannot rum multiple command on remote machine via SSH

2023-02-04 Thread Kamil Jońca
Ottavio Caruso writes: > Hi, > > LAP1 is a Thinkpad that I use only at home as a poor man's desktop. > > LAP2 is a second Thinkpad that I use mainly outdoors, on which I run > an SSH server to do some syncing every now and again. > > Both using latest Debian stable with similar sets of apps. > >