Articles of ssh keys

ssh-copy-id与密码在一行,可能吗?

我试图在Ansible中设置一个自动脚本来设置一个新的服务器,我使用ssh-copy-id将Ansible主服务器添加到新服务器的授权ssh密钥。 我创build了一个使用ssh-copy-id的脚本,但该命令正在询问新服务器的密码。 是否有可能在同一行中调用它的密码,以便我可以在脚本中自动执行它?

SSH密钥validation不起作用

我有一台服务器运行的Ubuntu 10.04(作为一个虚拟机),我无法连接使用SSH密钥身份validation,而不被要求input密码。 在发帖前我读了很多,但是我真的不知道我错过了什么。 服务器中的.ssh文件夹有700个权限, 授权的密钥文件有600个权限。 结果是这样的: drwx—— 2 myUser myUser 4096 Mar 26 12:15 .ssh -rw——- 1 myUser myUser 426 Mar 26 12:15 authorized_keys 检查/var/auth/auth.log ,我已经能够检测到这2条线,每当我login(我被要求input密码)重复: Authentication refused: bad ownership or modes for directory /home/myUser. Accepted password for myUser from myIP port 64916 ssh2 我认为密钥的configuration( authorized_keys的内容等)是可以的,因为我发现,如果我closures严格模式 ,我可以login而不被要求input密码,但是我不确定是否这样是安全的,我想要保护系统的入侵。 有谁知道这可能是我的问题吗?

在CentOS 7服务器上无法使用共享密钥ssh拒绝我们的密钥

我无法使用预共享密钥ssh到CentOS 7服务器,我得到一个“服务器拒绝我们的密钥”消息。 下面是使用-vv的ssh尝试 OpenSSH_7.2p2, OpenSSL 1.0.2h-fips 3 May 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 56: Applying options for * debug1: /etc/ssh/ssh_config line 67: Deprecated option "useroaming" debug2: resolving "my.server.net" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to my.server.net [xxx.xxx.xxx.xxx] port 22. debug1: Connection established. debug1: identity file /home/user/.ssh/id_rsa type 1 debug1: […]

连接由<ip> closures

我在Ubuntu服务器上。 我正在尝试启用SSH隧道,以便在我的项目中添加git remote。 在我本地的win7机器上,我用PuTTYgen生成密钥对。 我把公钥粘贴在authorized_keys文件中 我将私人PuTTY ppk文件path设置为putty Authconfiguration 当我尝试打开一个远程shell我得到错误Server refused our key 。 检查日志: Connection closed by <ip> [preauth] /var/log/auth.log Connection closed by <ip> [preauth] 。 更多信息: ~/.ssh/authorized-keys有权限664。 该文件被命名为authorized-keys not authorized_keys这可能是一个问题? 我错过了什么?

SSHconfiguration,公共密钥,权限被拒绝(公钥,密码)。 错误

我的任务:从Mac OS Snow Leopard客户端login到Ubuntu 10.10服务器,无需密码。 命令: client$ mkdir ~/.ssh client$ chmod 700 ~/.ssh client$ ssh-keygen -q -f ~/.ssh/id_rsa -t rsa Enter passphrase (empty for no passphrase): [empty] client$ chmod go-w ~/ client$ chmod 700 ~/.ssh client$ chmod go-rwx ~/.ssh/* client$ scp ~/.ssh/id_rsa.pub [email protected]:~ server$ mkdir ~/.ssh server$ chmod 700 ~/.ssh server$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys […]

解决哪个公共密钥用户用来访问服务器

是否有可能解决,哪些公共密钥用于授予用户访问服务器? 例如,有5个公钥存储在~/.ssh/authorized_keys文件中。 我想知道哪个键的使用频率最高,并根据密钥而不是密码进行身份validation来计算每个auth事件。

SSH公钥authentication

我试图configurationssh使用公钥authentication 链接 / etc / ssh / sshd_config已经有了这个参数。 RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication yes 但是我仍然被提示input密码。 如果我使用 PasswordAuthentication no 我无法login 任何build议? 它的工作原理,但只为root用户。 我的问题是,我有这个参数 PermitRootLogin no。 如果我使用的话,我可以用root用户login PermitRootLogin是。 在这个系统中,在这个目录中只有一个/root/.ssh目录是authorized_keys文件 如果在这个系统中没有为每个用户设置一个home / $ USER / .ssh目录和authorized_keys文件,我怎么能把这个添加到其他用户呢? 有没有一种方法来configuration每个用户? 我将需要每个用户不同的authorized_keys文件。 有可能configuration为不同的主机,域或ips? 类似于httpd.conf

使用特定于主机的声明更改ssh ControlPath

我有一种情况,需要使用两个不同的SSH密钥访问相同的SSH主机(GitHub)。 这是没有问题的,我可以很容易地通过别名主机名来设置它。 当这个configuration与我的SSH多路复用configuration相结合时,问题出现了。 我似乎无法用主机特定的声明覆盖我的默认ControlPath。 也许这只是它的工作方式? 也许这是一个错误? 难道我做错了什么? 顺便说一句,我在Mac 10.7上。 这是我的configuration: Host * ControlMaster auto ControlPath ~/.ssh/connections/ssh-%r@%h:%p Host github.com-X TCPKeepAlive yes ServerAliveInterval 60 ControlPersist 1h Hostname github.com User git IdentityFile ~/.ssh/id_rsa_X IdentitiesOnly yes ControlPath ~/.ssh/connections/ssh-%r@%hX:%p Host github.com TCPKeepAlive yes ServerAliveInterval 60 ControlPersist 1h 我已经修改了一点点,但似乎总是得到Host *声明中指定的ControlPath。 ssh -T [email protected] 使用id_rsa_X以正确的用户身份login,但在此创build域套接字: ~/.ssh/connections/[email protected]:22 而不是: ~/.ssh/connections/[email protected]:22 所以后来当我尝试使用id_rsa发出SSH命令时,由于连接复用,我得到了id_rsa_X用户。 换一种说法: ssh -T […]

使用SSH密钥进行服务器login时,为sudo用户使用非常安全的密码是否明智?

我不是在问这里怎么做,而是试图理解最佳实践和处理服务器安全的“正确”方法。 为了防止暴力破解密码攻击,我以多种方式保护了我的服务器,其中一个是受密码保护的SSH密钥,用于在任何用户(现在是单个开发者框)上login。 很明显,无论用户何时需要login,他都需要访问该密钥的密钥和密码。 但是,我想了解如何处理该(或任何)特定用户的系统密码,特别是在处理sudo时。 几个问题: 有没有在给每个用户一个密码的所有(所以他/她可以使用sudo)的价值? 如果是这样,使用一个疯狂的安全密码是这样(即384位+) 假设上面的答案是否定的: 任何用户每次需要运行一个sudo命令(yes lastpass,dashlane,1pass等都是选项,但是必须打开/validation/查找并复制真正长的密码,似乎是一个巨大的麻烦),记得这个密码怎么可能呢? 对于这些密码有足够的安全性,如果字典攻击能够在3秒内findsudo密码,那么这很重要吗? 提前谢谢!

为什么我每天都要用密码login到ssh?

当我尝试使用ssh-agent中的encryption密钥ssh时,我得到以下(使用ssh -vvv ): debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/cowens/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: BLAH debug3: sign_and_send_pubkey: RSA BLAH debug3: input_userauth_banner Access denied Access denied Connection closed by BLAH 我可以login,如果我强迫它使用密码( ssh -o PreferredAuthentications=keyboard-interactive -o […]