nixCraft 🐧 on Nostr: Try running the bash history command over ssh, and it will not work: ssh -t ...
Try running the bash history command over ssh, and it will not work:
ssh -t user@hostA -- "bash -ic 'history'"
Instead, you need:
ssh -t user@hostA -- "cat ~/.bash_history"
ssh -t user@hostA -- "cat ~/.bash_history | grep something"
#Unix #Linux #macOS #FreeBSD
Published at
2023-10-11 18:20:28Event JSON
{
"id": "8e20e4aa60a183d9e24c8136f2e8266ecbdab88eed94fcf0af2a12c558e492e9",
"pubkey": "cc3790930722bfa73e28f9a2aa0832706884305cb80687e20927c7960db99185",
"created_at": 1697048428,
"kind": 1,
"tags": [
[
"t",
"unix"
],
[
"t",
"linux"
],
[
"t",
"macos"
],
[
"t",
"freebsd"
],
[
"proxy",
"https://mastodon.social/users/nixCraft/statuses/111217765798808468",
"activitypub"
]
],
"content": "Try running the bash history command over ssh, and it will not work:\nssh -t user@hostA -- \"bash -ic 'history'\"\n\nInstead, you need:\nssh -t user@hostA -- \"cat ~/.bash_history\"\nssh -t user@hostA -- \"cat ~/.bash_history | grep something\"\n\n#Unix #Linux #macOS #FreeBSD",
"sig": "cb8832f1e34be6d1530033caf1dd5c325442975b87da56475f9f1b0e17fff034e4ea844da5022f232ba768cce47310222dee1e8beecd708a255914c251c4ab5f"
}