IPython: How to wipe IPython's history selectively & securely?

后端 未结 6 1230
北海茫月
北海茫月 2020-12-29 02:52

I have been learning how to use the paramiko package only to discover that all I stored passwords in plain text in IPython\'s %hist. Not so good.

6条回答
  •  梦毁少年i
    2020-12-29 03:02

    Combining @Ovidiu Ghinet's answer with @Matt's accepted answer:

    sqlite $(ipython locate)/profile_*/*.sqlite || sqlite3 $(ipython locate)/profile_*/*.sqlite
    

    Then from within sqlite console:

    delete from history where source like '%password%';
    select * from history; /* confirm that no passwords left        */
    .quit                  /* forgot how to exit sqlite console? ;) */
    

提交回复
热议问题