Articles of ssh keys

如何让ssh为存储在智能卡上的密钥发送证书

我有一个gpg密钥,我通过智能卡(yubikey neo)ssh到许多主机使用。 其中一些主机使用证书以及密钥来授权login。 对于本地存储的普通密钥,有三个文件涉及: id_rsa id_rsa.pub id_rsa-cert.pub 我让ssh一起使用.pub和-cert.pub文件来通过指定私钥文件-i〜 -i ~/.ssh/id_rsa进行authentication。 这使它提供了公钥和证书。 像这样: debug1: Authentications that can continue: publickey debug1: Offering RSA-CERT public key: /home/user/.ssh/id_rsa debug1: Server accepts key: pkalg [email protected] blen 1086 debug1: ssh_rsa_verify: signature correct 当私钥存储在智能卡上时,不提供这样的文件,即使提供了证书签名的RSA密钥,也不会发送证书: debug1: Next authentication method: publickey debug1: Offering RSA public key: cardno:000XXXXXXX2 由于缺less签名而被拒绝。

使用ssh密钥时强制更改过期的密码

我正在一个环境中,我有一个帐户在多个Linux机器帐户和密码独立pipe理(没有活动目录/ LDAP / etc)和密码每30天过期。 因此,我认为使用ssh密钥pipe理我的身份validation会更容易。 我能够使用我的SSH密钥进行身份validation就好了。 但是,我发现当我的密码过期时,当我尝试使用我的ssh密钥进行连接时,系统会提示我更改密码。 这是正常的行为? 我认为使用密钥对的全部重点是绕过你的密码。 如果我使用密码login,是否只能提示更改我的密码?

EC2 SSHlogin临时挂起“进入交互式会话”

我一直在研究这个好几个小时,不知道为什么会这样。 最初标记为互联网,但检查了我的速度(37下,10上)。 我从加利福尼亚州去了俄勒冈州,从那以后,我的亚马逊EC2在SSHlogin上挂了几分钟。 这个命令: ssh -vvv -o "ProxyCommand nc %h %p" -i “*****.pem" root@***.***.***.*** 输出: OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data *****/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 20: Applying options for * debug1: Executing proxy command: exec nc ***.***.***.*** 22 debug1: key_load_public: No such file or directory debug1: identity file **********.pem […]

你可以使默认的客户端密钥长度更大的SSH密钥?

当用户使用ssh-keygen创buildRSA密钥对时,默认密钥长度为2048位。 你可以用-b参数在命令行中覆盖它,但是很less有用户会打扰。 如本文所述,如果您需要超过2030年的安全性,build议使用3072或更大的密钥长度。是否有办法使3072(或4096)成为所有生成密钥的默认长度? 我没有看到它在ssh_config或sshd_config手册页。 还是需要重新编译程序?

与多个用户设置RSA

我最近设置了一台服务器,并且在服务器上设置了RSAauthentication。 我的问题是,如何为不同的用户设置RSA身份validation? 截至目前,唯一拥有RSAauthentication的用户是root用户,我宁愿不要这样做。 我已经尝试将我的RSA密钥添加到/home/username/.ssh/authorized_keys并重新启动SSHD,但仍然无法使用该用户名login。 有人有主意吗? Damnit,Jim,我是一名开发人员而不是服务器pipe理员。

当我使用私钥进行连接时,Duplicity还原报告“无效的SSH密码”

我正在testing恢复0.6.15的副本备份。 我可以使用以下命令和我的私钥使用ssh和sftplogin到我的备份服务器: … SFTP root@client:~# sftp -oPort=7843 [email protected] Enter passphrase for key '/root/.ssh/id_rsa': Connected to 192.168.xx sftp> exit … SSH root@client:~# ssh -p7843 [email protected] Enter passphrase for key '/root/.ssh/id_rsa': Connected to 192.168.xx Last Login: …. 我有以下恢复脚本用于还原签名和encryption备份的内容: #!/bin/bash export SIGN_PASSPHRASE='<signed-key-passphrase' export PASSPHRASE='<encryption-passphrase>' duplicity -v9 –encrypt-key="<encryption-key-id>" –sign-key="<signed-key-id>" –force \ scp://[email protected]:7843//home/backupUser/backup /mnt/restore 但是,当我运行脚本的重复性: root@client~#: ./restore_script.sh 重复使用它来尝试login到我的备份服务器时,Duplicity给我以下错误: Using archive […]

在VPS上重置防火墙后,不能SSH

我遇到了麻烦,试图用blacknight SSH连接到我的Debian 5 VPS。 它工作正常,直到我做了以下事情:login到“Parallels基础架构pipe理器” – >容器 – >防火墙 – >设置为“普通防火墙设置”。 它告诉我,IPTables出现了一个错误,并提供了一个checkbox来重置防火墙设置,我select了这个选项。 我可以看到应用了默认规则(任何端口上的任何人都可以发生任何事情)。 每当我尝试SSH时,我得到以下debugging信息: thomas@localmachine:~/.ssh$ ssh -v thomas@hostname OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to hostname [***********] port 22. debug1: Connection established. debug1: identity file /home/thomas/.ssh/id_rsa type 1 debug1: Checking blacklist file […]

复制Putty生成的SSH密钥对MacOS

我有一个目标BSD机器,我从我的窗口框连接到,我复制了由腻子生成的公钥和私钥对,我试图用Mac OS在不同的笔记本电脑上使用它们。 我在MAC上将密钥复制到〜/ .ssh /文件夹,但是它们无法连接到BSD机器。 这些是我的日志。 debug1: Authentications that can continue: publickey debug3: start over, passed a different list publickey debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /Users/username/.ssh/public debug1: PEM_read_PrivateKey failed debug1: read PEM private key done: type <unknown> debug3: […]

对于从工作EC2映像创build的EC2实例,SSHlogin失败

我有一个function强大的EC2实例与几个用户,其中一些被chrooted到他们的主目录,其中一些是只有ftp和没有shell访问,等等… ec2用户是主要的pipe理员帐户,虽然其他人也有根访问和完整的sshlogin。 在运行的实例中一切正常。 我可以拍摄实例的快照图像,并从快照中启动新的实例。 无论我按照与新实例关联的密钥对(使用ec2用户的原始密钥对,创build新密钥对还是使用无密钥对)来select,一旦新实例启动并运行,我无法ssh到服务器使用ec2用户或任何其他SSH启用用户。 但是,FTP工作正常。 就我所知,安全组不是问题,就我所知,允许传入的通信(反正它和原始实例是同一个安全组)。 login尝试的/ var / log / secure给我: sshd[1739]: debug1: userauth-request for user ec2-user service ssh-connection method none sshd[1739]: debug1: attempt 0 failures 0 sshd[1738]: debug1: user ec2-user does not match group list sftponly at line 142 sshd[1738]: debug1: PAM: initializing for "ec2-user" sshd[1738]: debug1: PAM: setting PAM_RHOST to "…" […]

通过networking共享限制对.ssh文件夹的访问

我运行一个运行Ubuntu Server 14.04的小型服务器,刚刚注意到用户主目录中的.ssh文件夹可以通过SMB和NFS访问。 SMB和NFS都是安全的,但是我觉得这是服务器安全方面的一个弱点,因为我只通过密钥authentication限制了对SSH的访问。 除了通过SSH之外,每个人在确保无法访问.ssh文件夹方面做了什么? 我一直在环顾四周,找不到一个普遍接受的方法。 我已经考虑限制和排除对NFS和SMB共享内的某些文件夹的访问,但这种感觉更像是一种解决方法,而不是对我的特定解决scheme。