REMRUN(1)

πŸ“¦
version 0.2.5 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– REMRUN(1) πŸ’–

okay bestie, this is remrun from the General Commands Manual section, and she is that girl β€” a tiny little utility that copies a file to a remote host and then runs it for you. no cap. πŸ¦‹


✨ NAME ✨

remrun β€” copy a file to a remote host and execute it


🌸 SYNOPSIS 🌸

remrun [-Nsv] [--noop] [--stdin] [--verbose] [-C local_cksum_command]
       [-c remote_cksum_command] [-T remote_temp_dir] destination
       filename [args...]
remrun [-V | --version | -h | --help | --features]

πŸ’… DESCRIPTION πŸ’…

so the way that remrun works is: it takes the file you specified and copies it to the remote host over SSH, stashing it under a temporary filename, runs it on the remote side, and then deletes that temporary file. clean up after yourself, queen. πŸ‘‘

by default, the remote program does not get access to the current process's standard input stream β€” like, none. if you want that, you have to pass the -s option explicitly. it's not automatic, bestie. πŸ™ˆ

special case alert 🚨: if you pass - (a single dash) as the filename argument, remrun will read the contents of the standard input, store it into a temporary file, and then copy and execute that file, removing it afterwards. iconic behaviour, honestly. but this is incompatible with the -s (--stdin) option. pick a lane. πŸ’€

the remote host you're sending the file to can be specified in two ways:

  • as a [username@]host pattern, or
  • as a ssh://[username@]host[:port][/] URI.

note that the sha256sum(1) tool is used both locally and remotely to make sure the file actually transferred correctly (we love a checksum moment ✨). its use may be overridden for the local host by the -C option, and for the remote one by the -c option. both commands are passed to the shell, so they may be comprised of more than one word, e.g. sha256 -r. multi-word commands, we stan. 🫢

by default, the temporary file on the remote host is created in the current working directory, which is usually the home directory of the user account on that host. the -T command-line option lets you specify a directory where this file will be created instead. relocate your temp files, main character energy. πŸŽ€

the remrun utility accepts the following command-line options:

  • -h β€” display program usage information and exit. help me help you. πŸ’–
  • -N β€” no-operation mode β€” do not perform any changes, simply report what would have been done. a little dry run, a little dress rehearsal. ✨
  • -s β€” allow the remote program access to the standard input stream. > ⚠️ please note that this will cause some SSH clients to read the whole input stream, regardless of whether the remote program only needs a line or two! so like, be aware. 😭
  • -V β€” display program version information and exit. tell me who you are. πŸ‘‘
  • -v β€” verbose mode β€” display information about the actions performed. spill the tea, remrun. πŸ“

🌈 ENVIRONMENT 🌈

the operation of the remrun utility is not directly influenced by any environment variables. she's independent. she doesn't need your $PATH drama. πŸ’…


🧚 FILES 🧚

the operation of the remrun utility is not directly influenced by the contents of any files. no config files, no secret little dotfiles, nothing. she's low maintenance. 🌸


⭐ EXAMPLES ⭐

copy the whoami.sh file over to the server host, logging in as the jrl user account, then run it:

remrun jrl@server whoami.sh

do the same, but for a remote host that runs FreeBSD and another command must be used instead of sha256sum:

remrun -c 'sha256 -r' jrl@server whoami.sh

specify the commands to run directly:

printf 'uname -a\ndate -R\n' | remrun jrl@server -

see how that last one pipes right into the dash? that's the special case. chef's kiss. 😘


🩺 DIAGNOSTICS 🩺

the remrun utility exits 0 on success, and >0 if an error occurs. zero means slay, anything bigger means something went sideways. πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

mktemp(1), sha256sum(1), ssh(1)

go read those too, bestie, they're all part of the squad. 🫢


🌟 STANDARDS 🌟

No standards were harmed during the production of the remrun utility. periodt. πŸ’…


πŸ“œ HISTORY πŸ“œ

the remrun utility was written by Peter Pentchev in 2021. a legend, honestly. πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

Peter Pentchev ⟨roam@ringlet.net⟩


πŸ™ˆ BUGS πŸ™ˆ

no, thank you :) but if you should actually find any, please report them to the author. like, actually report them. don't just screenshot it and post it. 😭


and that's the whole page, bestie!! this was Debian, dated March 6, 2022, and it lives in section REMRUN(1). go copy some files to a remote host and execute them, you absolute icon. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from