Live data from Hacker News

Show HN: HiSHtory: Your shell history in context, synced, and queryable

github.com

51–60 of 75 posts

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#51
post #35

Anyone/anything solving the issue of bash histories in multiple (intricated) tmux sessions is an INSTANT win !!!! [Q: can this tool help? As far as in understand, it seems that YEEEES!!!]

I solved that particular issue by using this in my .bashrc

#write to history file at each shell prompt

    export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
(Unless I read your comment wrong.)

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#52
post #40

Earlier quoted context omitted.

I think my main concern here is the fact that you're putting secrets in your shell history!

Mistake happen. Yesterday I was tired and working on a friend serveur. The ssh prompt was different and I entered the password from a account while the remote port has hang up on me. So effectively typing “password” straight on my shell. His password is in my history now. I removed it but that type of thing happen all the time. ( Not that much in a professional settings, password tends to fade away )

Pro-tip: if you wanna hide stuff from your shell history, enter a space/blank before the actual command.

Not that it probably would have helped in this situation, but maybe useful for others.

Usually if I have to enter secrets in my shell, I do something like this in order to save the useful stuff to history but hiding the secrets:

- ` export PASSWORD=hunter2` (notice the space before "export")

- `service-cli login username $PASSWORD` (no space before, gets saved to shell history)

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#53
post #40
post #37

Sending your command history automatically over the network is always an huge security risk. This tool atleast have a security section in the readme, but nothing about operational security and how to guard against hacks of one synced agent. I will try it because the history tool looks like an interesting take, but the security model is not ok for multi computer use.

I think my main concern here is the fact that you're putting secrets in your shell history!

I've certainly entered passwords at the shell prompt by accident. This doesn't happen often, but it sure does.

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#54
Is my new Mycroft AI device capturing my thoughts and sending them on to a Borg-like hivemind? I was just thinking of something like this the other day and here it is on HN!

All jokes aside, from reading the threads, I see there are other alternatives, most interestingly atuin and fzf. I used fzf for a while, but didn't use the history features. Atuin looks amazing, and installs using nix-shell. My litmus test for whether something is safe to use is nix-shell these days; I'm not excited about running a curl script into python as my starting point!

Does anyone have references on whether atuin and fzf can be used together, or should you only use one or the other? I liked fzf but the encrypted remote sync feature of atuin looks really fascinating.

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#55

Earlier quoted context omitted.

Mistake happen. Yesterday I was tired and working on a friend serveur. The ssh prompt was different and I entered the password from a account while the remote port has hang up on me. So effectively typing “password” straight on my shell. His password is in my history now. I removed it but that type of thing happen all the time. ( Not that much in a professional settings, password tends to fade away )

Pro-tip: if you wanna hide stuff from your shell history, enter a space/blank before the actual command. Not that it probably would have helped in this situation, but maybe useful for others. Usually if I have to enter secrets in my shell, I do something like this in order to save the useful stuff to history but hiding the secrets: - ` export PASSWORD=hunter2` (notice the space before "export") - `service-cli login u…

While ignoring commands preceded by a space character is absolutely one of my very favorite shell features, it usually isn't enabled by default (YMMV).

HISTCONTROL=ignorespace # bash

setopt hist_ignore_space # zsh

These go into ~/.bashrc or ~/.zshrc, respectively. zsh is really smart about this and always enables you to retrieve the immediate previous line with arrow-up, no matter whether it's got preceding whitespace or not.

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#56

Earlier quoted context omitted.

Mistake happen. Yesterday I was tired and working on a friend serveur. The ssh prompt was different and I entered the password from a account while the remote port has hang up on me. So effectively typing “password” straight on my shell. His password is in my history now. I removed it but that type of thing happen all the time. ( Not that much in a professional settings, password tends to fade away )

Pro-tip: if you wanna hide stuff from your shell history, enter a space/blank before the actual command. Not that it probably would have helped in this situation, but maybe useful for others. Usually if I have to enter secrets in my shell, I do something like this in order to save the useful stuff to history but hiding the secrets: - ` export PASSWORD=hunter2` (notice the space before "export") - `service-cli login u…

why use `export` ? That is a terrible idea.

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#57
post #40
post #37

Sending your command history automatically over the network is always an huge security risk. This tool atleast have a security section in the readme, but nothing about operational security and how to guard against hacks of one synced agent. I will try it because the history tool looks like an interesting take, but the security model is not ok for multi computer use.

I think my main concern here is the fact that you're putting secrets in your shell history!

Some apps only accept password in commandline.

The better written ones might accept it in env but that will also stay in history.

But if someone have access to your home they can put keylogger in the .profile/.bashrc so it's not really relevant...

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#58
post #57
post #40

Earlier quoted context omitted.

I think my main concern here is the fact that you're putting secrets in your shell history!

Some apps only accept password in commandline. The better written ones might accept it in env but that will also stay in history. But if someone have access to your home they can put keylogger in the .profile/.bashrc so it's not really relevant...

Sure, but something like this also works well:

`the-command --password $(read -s;echo $REPLY)`

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#59
post #40
post #37

Sending your command history automatically over the network is always an huge security risk. This tool atleast have a security section in the readme, but nothing about operational security and how to guard against hacks of one synced agent. I will try it because the history tool looks like an interesting take, but the security model is not ok for multi computer use.

I think my main concern here is the fact that you're putting secrets in your shell history!

[deleted]

Re: Show HN: HiSHtory: Your shell history in context, synced, and queryable

#60

Earlier quoted context omitted.

Mistake happen. Yesterday I was tired and working on a friend serveur. The ssh prompt was different and I entered the password from a account while the remote port has hang up on me. So effectively typing “password” straight on my shell. His password is in my history now. I removed it but that type of thing happen all the time. ( Not that much in a professional settings, password tends to fade away )

Pro-tip: if you wanna hide stuff from your shell history, enter a space/blank before the actual command. Not that it probably would have helped in this situation, but maybe useful for others. Usually if I have to enter secrets in my shell, I do something like this in order to save the useful stuff to history but hiding the secrets: - ` export PASSWORD=hunter2` (notice the space before "export") - `service-cli login u…

+1 to prefixing with a space. hiSHtory supports this out of the box so that anything prefixed with a space isn't recorded (even if your shell doesn't do that by default!). And if you do ever mess up, `hishtory redact` can be used to delete history entries.
Post reply on HN