IPython:如何有选择地擦除 IPython 的历史 &安全吗? [英] IPython: How to wipe IPython's history selectively & securely?

查看:44
本文介绍了IPython:如何有选择地擦除 IPython 的历史 &安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在学习如何使用 paramiko 包,结果发现我所有的密码都以纯文本形式存储在 IPython 的 %hist 中.不太好.

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.

因此,我需要删除存储在 %hist 中的特定部分.话虽如此,我不想抹去整个历史.- 只有我不小心输入password = 或类似选择的术语的部分.

I therefore need to get rid of particular parts of what is stored in %hist. Saying that, I do not want to wipe the whole history. - Only the parts where I have been careless enough to type password = or similar chosen terms.

谢谢

我不需要的评论:

  • %clear 只清除会话.它不会抹去历史.
  • 是的.从现在开始,我将只使用 xSA_keys.
  • %clear only clears the session. It does not wipe the history.
  • Yes. I will only use xSA_keys from now on.

推荐答案

History 默认存储在 $(ipython locate)/profile_default/history.sqlite 上.您可以删除该文件,或者对其执行任何您想要的操作(安全擦除等).这是一个 sqlite 文件,因此您可以使用任何 sqlite 程序加载它并对其进行查询.

History is store on $(ipython locate)/profile_default/history.sqlite by default. You can remove the file, and or do any operation you want on it (secure erase, etc..). It's an sqlite file so you can load it with any sqlite program and do query on it.

检查 $(ipython locate)/profile_default/ 和其他 $(ipython locate)/profile_xxx 你没有任何其他历史文件.$(ipython locate) 通常是 ~/.ipython/ 但可以变化:

Check in $(ipython locate)/profile_default/ and other $(ipython locate)/profile_xxx that you do not have any other history files. $(ipython locate) is usually ~/.ipython/ but can vary:

ls $(ipython locate)/profile_*/*.sqlite

这篇关于IPython:如何有选择地擦除 IPython 的历史 &安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆