AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-183868

Sunil Bojanapally's questions

Martin Hope
Sunil Bojanapally
Asked: 2016-07-05 04:32:48 +0800 CST

将 HyperV 2008R2 映像转换为 2012R2

  • 1

我有一个 HyperV 2008R2 VHD 映像,它使用基于 2008R2 的模板配置创建 - 2G RAM、40GB 磁盘、2 个 CPU 和 2 个桥接端口网络接口。

想知道是否可以将我现有的 2008R2 VHD 映像转换为 2012R2 VHDX 版本,使实例在 HyperV 2012R2 上运行?如果是的话,什么程序来实现这个?

hyper-v windows-server-2008-r2 windows-server-2012-r2 hyper-v-server-2008-r2 hyper-v-server-2012-r2
  • 2 个回答
  • 223 Views
Martin Hope
Sunil Bojanapally
Asked: 2015-10-16 04:16:32 +0800 CST

EC2 密钥对身份验证

  • -2

我创建了一个自定义 ec2 ami 映像,并尝试USERVM按照以下步骤对用户使用 ec2 密钥对身份验证来验证 aws 实例。

  1. ami 创作。
  2. ec2-运行实例...
  3. 使用 ec2-create-keypair 创建私钥。
  4. 将私钥存储在 ~/.ssh/keypair.pem 下并提供权限。
  5. 使用连接 aws 实例ssh -v -i ~/.ssh/keypair.pem USERVM@ec2-instance.com

对应的调试日志:

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-52-23-236-90.compute-1.amazonaws.com [52.23.236.90] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/keypair_14_10_721pm.pem type -1
debug1: identity file /root/.ssh/keypair_14_10_721pm.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u2
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY   
debug1: Server host key: ECDSA 12:6d:09:82:fd:4b:0d:1d:88:3d:2a:65:31:c0:ad:cd
The authenticity of host 'ec2-52-23-236-90.compute-1.amazonaws.com (52.23.236.90)' can't be established.
ECDSA key fingerprint is 12:6d:09:82:fd:4b:0d:1d:88:3d:2a:65:31:c0:ad:cd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-52-23-236-90.compute-1.amazonaws.com,52.23.236.90' (ECDSA) to the list of known hosts.
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/keypair_14_10_721pm.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
USERVM@ec2-52-23-236-90.compute-1.amazonaws.com's password:
debug1: Authentication succeeded (password).
Authenticated to ec2-52-23-236-90.compute-1.amazonaws.com 

sshd_config 如下:

# Package generated configuration file
# See the sshd(8) manpage for details
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
#PermitRootLogin yes
PermitRootLogin without-password
StrictModes no
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile     %h/.ssh/authorized_keys
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
#IgnoreUserKnownHosts yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
UseDNS no

我面临的问题 aws 实例在尝试使用 user 登录时要求输入密码USERVM。用户的公钥USERVM在启动时生成并放置在 aws instance 下/home/USERVM/.ssh/authorized_keys。但是,对于名为的用户,相同的方法可以root正常工作,而无需输入密码。任何帮助在这里表示赞赏。

编辑:对用户的权限USERVM是:

$ sudo ls -la /home/
total 36
drwxr-xr-x  6 root       root      4096 Oct 14 12:34 .
drwxr-xr-x 27 root       root      4096 Oct 15 16:39 ..
drwxr-xr-x  2 admin      www-data  4096 Oct 14 12:34 admin
drwxr-xr-x  3 USERVM     www-data  4096 Oct 15 16:42 USERVM
drwx------  2 root       root     16384 Oct 14 12:38 lost+found
drwxrwsrwx 22 tuser      www-data  4096 Oct 15 16:40 tuser
$ sudo ls -la /home/USERVM/
total 16
drwxr-xr-x 3 USERVM  www-data 4096 Oct 15 16:42 .
drwxr-xr-x 6 root    root     4096 Oct 14 12:34 ..
-rw------- 1 USERVM  www-data  105 Oct 15 16:42 .bash_history
drwx------ 2 root    root     4096 Oct 15 16:38 .ssh
$ sudo ls -la /home/USERVM/.ssh/
total 12
drwx------ 2 root    root     4096 Oct 15 16:38 .
drwxr-xr-x 3 USERVM  www-data 4096 Oct 15 16:42 ..
-rw------- 1 root    root     1203 Oct 15 16:39 authorized_keys

当尝试使用与用户相同的程序登录时,admin它USERVM会要求输入密码,但是root它无需输入密码即可工作。

ssh
  • 1 个回答
  • 927 Views
Martin Hope
Sunil Bojanapally
Asked: 2013-08-01 11:16:12 +0800 CST

SSH 基于主机的身份验证:SSH 客户端如何强制使用给定的密钥位置

  • 2

ssh上的 Linux 手册页说关于基于主机的身份验证工作,据SSH server must be able to verify the client's host key (see the description of /etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts, below) for login to be permitted.我所知,它~/.ssh/known_hosts包含客户端访问的 SSH 服务器的主机密钥。

因此,在从中读取身份私钥的基于密钥的身份验证中~/.ssh/id_rsa,~/.ssh/id_dsa我如何强制在基于主机的身份验证中仅使用密钥在不同位置查找密钥~/.ssh/known_hosts。

在基于密钥的身份验证中。我们可以使用 指向不同的位置ssh -i /new/path/to/id_rsa <server IP>,并且想知道使用基于主机的身份验证如何可行。

提前致谢!

linux
  • 2 个回答
  • 3412 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve