小编oHo*_*oHo的帖子

使用 gssapi-keyex 或 gssapi-with-mic 进行 SSH 身份验证(不允许使用公钥)

我的公司已禁用 SSH 公钥身份验证,因此每次我都必须手动输入密码(我不打算更改/etc/ssh/sshd_config)。

但是gssapi-keyexgssapi-with-mic身份验证已启用(请参阅下面的ssh调试输出)。

在这种情况下如何使用自动登录?
我可以利用gssapi-keyex和/或gssapi-with-mic身份验证吗?

> ssh -v -o PreferredAuthentications=publickey hostxx.domainxx
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to hostxx.domainxx [11.22.33.44] port 22.
debug1: Connection established.
debug1: identity file /home/me/.ssh/identity type -1
debug1: identity file /home/me/.ssh/id_rsa type -1
debug1: identity file /home/me/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 …
Run Code Online (Sandbox Code Playgroud)

ssh authentication kerberos

18
推荐指数
2
解决办法
7万
查看次数

使用 emacs 命令定制的 vim(仅限插入模式)

我是emacs用户,我必须切换到vim. 但是我想念vim插入模式下的一些基本 emacs 命令:

  1. C-A
  2. C-E
  3. C-K
  4. C-Y
  5. C-x C-s
  6. ......还有其他一些

我知道我可以按Escape然后按以下一些键,最后按 key i

  1. ^
  2. $
  3. d$
  4. p
  5. :w [进入]
  6. ...

但是我想保持vim插入模式并避免按Escape/i键。

在网络上,我找到了对emacs( vi-mode, vip, viper, vimpulse, vim-mode, evil) 的自定义。但尚未发现相反的情况:自定义vim以使用emacs命令...

我只emacsvim 插入模式下的命令感兴趣。只是一些基本命令,如bash命令:C-A, C-E, C-K, C-Y, C-U... (是的C-U,不是默认emacs命令,但我也喜欢它)。

vim keyboard-shortcuts emacs vi key-mapping

12
推荐指数
3
解决办法
4048
查看次数

在具有相同名称的 shell 函数中调用命令的最佳方法

我喜欢使用相同的名称将命令封装在 shell 函数中。但是为了避免 shell 函数递归调用自身,我指定命令的完整路径作为以下示例:

less()
{
    test 0 -lt $# && echo -ne "\e]2;$@\a\e]1;$@\a"     # Window title
    /usr/bin/less -i -rS --LONG-PROMPT --shift 5 "$@"
}
Run Code Online (Sandbox Code Playgroud)

但是对于某些命令,我​​不想指定路径,因为它可能会改变。我更愿意使用$PATH.

例如,我的以下尝试无法mvn使用反斜杠调用命令:\mvn

mvn()  # colorizes maven output
{
        \mvn "$@" 2>&1 | #here: the shell-function recursively calls itself indefinitely
        sed -u '                                             
    s/^\[ALL\].*/\o033[1;37m&\o033[0m/
  s/^\[FATAL\].*/\o033[1;31m&\o033[0m/
  s/^\[ERROR\].*/\o033[1;31m&\o033[0m/
s/^\[WARNING\].*/\o033[1;33m&\o033[0m/
   s/^\[INFO\].*/\o033[1;37m&\o033[0m/
  s/^\[DEBUG\].*/\o033[1;36m&\o033[0m/
  s/^\[TRACE\].*/\o033[1;32m&\o033[0m/'
}
Run Code Online (Sandbox Code Playgroud)

绕过此问题的最佳方法是什么?
请不要建议使用不同的 shell 函数名称。

(我通常使用,bash但我对其他 shell 解决方案感兴趣。)

shell function command

3
推荐指数
1
解决办法
1499
查看次数