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-157599

David's questions

Martin Hope
David
Asked: 2016-04-23 13:56:06 +0800 CST

Ubuntu - SQL Server 2012 - Microsoft ODBC 驱动程序 13 - 错误:18456,严重性:14,状态:8

  • 0

我已经尝试在 Ubuntu 中运行“Microsoft ODBC Driver 13 for SQL Server”两天了,但我没有想法/已经筋疲力尽了谷歌。

我的测试机器是一个 vagrant 虚拟机,这些是 bash 脚本的相关部分,它充当配置器:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get install -y python-software-properties vim curl libgss3 libstdc++6 git-core libpcre3-dev make
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y

和

cd /home/vagrant

wget https://download.microsoft.com/download/2/E/5/2E58F097-805C-4AB8-9FC6-71288AB4409D/msodbcsql-13.0.0.0.tar.gz
tar xvzf msodbcsql-13.0.0.0.tar.gz

sudo chmod +x msodbcsql-13.0.0.0/build_dm.sh
sudo chmod +x msodbcsql-13.0.0.0/install.sh

./msodbcsql-13.0.0.0/build_dm.sh --accept-warning

directory=$(ls /tmp | grep 'unixODBC')
path="/tmp/$directory/unixODBC-2.3.1"
cd $(echo $path)
sudo make install

cd /home/vagrant/msodbcsql-13.0.0.0/
sudo ./install.sh install --accept-license

sudo ln -s /usr/lib64/libodbcinst.so.2 /lib/x86_64-linux-gnu/libodbcinst.so.2

cat << EOF | sudo tee -a /home/vagrant/.odbc.ini
[MSSQL]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.0.so.0.0
Server=<my_server>\<my_sqlserver_instance_name>,1433
Database=PDS
Threading=1
UsageCount=1
EOF

sudo chown vagrant:vagrant /home/vagrant/.odbc.ini

这是安装日志的相关位:

[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on libmsodbcsql-13.0.so.0.0
[Fri Apr 22 20:16:59 UTC 2016] Copying install.sh to /opt/microsoft/msodbcsql/13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on install.sh
[Fri Apr 22 20:16:59 UTC 2016] Copying build_dm.sh to /opt/microsoft/msodbcsql/13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on build_dm.sh
[Fri Apr 22 20:16:59 UTC 2016] Copying README to /opt/microsoft/msodbcsql/13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on README
[Fri Apr 22 20:16:59 UTC 2016] Copying LICENSE to /opt/microsoft/msodbcsql/13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on LICENSE
[Fri Apr 22 20:16:59 UTC 2016] Copying WARNING to /opt/microsoft/msodbcsql/13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on WARNING
[Fri Apr 22 20:16:59 UTC 2016] Copying INSTALL to /opt/microsoft/msodbcsql/13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on INSTALL
[Fri Apr 22 20:16:59 UTC 2016] Copying bin/bcp.rll to /opt/microsoft/msodbcsql/13.0.0.0/en_US
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on bcp.rll
[Fri Apr 22 20:16:59 UTC 2016] Copying bin/SQLCMD.rll to /opt/microsoft/msodbcsql/13.0.0.0/en_US
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on SQLCMD.rll
[Fri Apr 22 20:16:59 UTC 2016] Copying bin/BatchParserGrammar.dfa to /opt/microsoft/msodbcsql/13.0.0.0/en_US
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on BatchParserGrammar.dfa
[Fri Apr 22 20:16:59 UTC 2016] Copying bin/BatchParserGrammar.llr to /opt/microsoft/msodbcsql/13.0.0.0/en_US
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on BatchParserGrammar.llr
[Fri Apr 22 20:16:59 UTC 2016] Copying lib64/msodbcsqlr13.rll to /opt/microsoft/msodbcsql/13.0.0.0/en_US
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on msodbcsqlr13.rll
[Fri Apr 22 20:16:59 UTC 2016] Copying docs/en_US.tar.gz to /opt/microsoft/msodbcsql/13.0.0.0/docs/en_US
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on en_US.tar.gz
[Fri Apr 22 20:16:59 UTC 2016] Copying include/msodbcsql.h to /opt/microsoft/msodbcsql/13.0.0.0/include
[Fri Apr 22 20:16:59 UTC 2016] Setting permissions on msodbcsql.h
[Fri Apr 22 20:16:59 UTC 2016] Extracting documentation from /opt/microsoft/msodbcsql/13.0.0.0/docs/en_US/en_US.tar.gz
...
[Fri Apr 22 20:16:59 UTC 2016] Creating symbolic links
[Fri Apr 22 20:16:59 UTC 2016] Linking bcp to bcp-13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Linking sqlcmd to sqlcmd-13.0.0.0
[Fri Apr 22 20:16:59 UTC 2016] Registering the Microsoft ODBC Driver 13 for SQL Server driver
odbcinst: Driver installed. Usage count increased to 1.
    Target directory is /etc

ldd 显示满足所有依赖项:

vagrant@vagrant-ubuntu-trusty-64:~$ ldd /opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.0.so.0.0
    linux-vdso.so.1 =>  (0x00007ffd109e8000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fde5d698000)
    libodbcinst.so.2 => /lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007fde5d486000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fde5d280000)
    libgss.so.3 => /usr/lib/libgss.so.3 (0x00007fde5d074000)
    libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fde5cda9000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fde5c9cc000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fde5c76d000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fde5c460000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fde5c159000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fde5bf42000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fde5bd24000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fde5b95e000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fde5dc8e000)
    libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fde5b754000)
    libshishi.so.0 => /usr/lib/libshishi.so.0 (0x00007fde5b4fa000)
    libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fde5b2ca000)
    libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fde5b0c6000)
    libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fde5aebb000)
    libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fde5acb6000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fde5aa9b000)
    libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fde5a886000)
    libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007fde5a5c8000)
    libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007fde5a348000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fde5a142000)
    libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007fde59f0f000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fde59cf5000)
    libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fde59ab3000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fde598ab000)

当我尝试测试驱动程序时,这是响应:

vagrant@vagrant-ubuntu-trusty-64:~$ isql -v MSSQL sa <password>
[28000][unixODBC][Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'sa'.
[ISQL]ERROR: Could not SQLConnect

在 SQL Server 错误日志中,我有这个:

2016-04-22 13:35:04.52 Logon       Error: 18456, Severity: 14, State: 8.
2016-04-22 13:35:04.52 Logon       Login failed for user 'sa'. Reason: Password did not match that for the login provided. [CLIENT: <my_ip>]

我可以使用 sa 用户登录到命名服务器,并使用 Microsoft SQL Server Management Studio 登录“SQL Server 身份验证”,所以我不认为这是一个“Windows 身份验证”问题,这似乎是此错误严重性的标准答案-状态组合。

我不知道从这里去哪里。任何帮助是极大的赞赏!!!

linux ubuntu odbc sql-server-2012 unixodbc
  • 1 个回答
  • 1767 Views
Martin Hope
David
Asked: 2013-01-23 13:14:13 +0800 CST

EC2 SSH / SFTP 问题

  • 0

我在这个问题上做了很多搜索,但找不到任何特别相关的东西。

我有许多跨区域分布的实例,并分组到各种负载均衡器中。其中一组是各种不同应用程序用于执行常见和安全任务的“API”。

在 API 组中,我们有一个使用弹性 IP 的实例,这样我们就可以可靠地使用 crons 来执行 rsync 等任务。在我之前有人还认为将这个 IP 硬编码到典型意大利面条式的各种应用程序中是个好主意code if else forest fashion...长话短说,非常重要的例子。

两天前,我突然无法通过 SSH 连接到这个人(它是一年多前创建的)。pem 密钥适用于所有其他实例,这些实例已经存在了相对相同的时间。

这是使用ssh -v -i path/file.pem user@ip在家用机器上(昨天)尝试连接失败的输出

ssh -v -i <path>/<file>.pem <user>@<ip>                                                                                             
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 <ip> [<ip>] port 22.                                              
debug1: Connection established.                                                                                     
debug1: identity file /home/<user>/.ssh/id_rsa type -1                                                          
debug1: identity file /home/<user>/.ssh/id_rsa-cert type -1                                                 
debug1: identity file /home/<user>/.ssh/id_dsa type -1                                                          
debug1: identity file /home/<user>/.ssh/id_dsa-cert type -1
debug1: identity file /home/<user>/.ssh/id_ecdsa type -1
debug1: identity file /home/<user>/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
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 75:43:6d:03:43:f5:89:fa:8d:fe:64:e1:39:9a:73:26
debug1: Host '<ip>' is known and matches the ECDSA host key.
debug1: Found key in /home/<user>/.ssh/known_hosts:78
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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: .ssh/<file>.pem
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/<user>/.ssh/id_rsa
debug1: Trying private key: /home/<user>/.ssh/id_dsa
debug1: Trying private key: /home/<user>/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).

最后,在搜索了几个小时之后,我运行了ssh -Tvvv -i path/file.pem user@ip并且神奇地与实例建立了调试连接。

这是用家里的机器完成的。我终止了连接,并正常连接。没问题。从办公室的服务器连接没有问题。

今天我无法从办公室的机器通过 SSH 进入实例,并且所有转换后的密钥也不适用于此实例(即 filezilla 等的 ppk 密钥)

这是工作机器(家用机器)的 -v 调试输出

ssh -v -i <path>/<file>.pem <user>@<ip>
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 <ip> [<ip>] port 22.
debug1: Connection established.
debug1: identity file /home/<user>/.ssh/<file>.pem type -1
debug1: identity file /home/<user>/.ssh/<file>.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
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 75:43:6d:03:43:f5:89:fa:8d:fe:64:e1:39:9a:73:26
debug1: Host '<ip>' is known and matches the ECDSA host key.
debug1: Found key in /home/<user>/.ssh/known_hosts:78
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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: .ssh/<file>.pem
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/<user>/.ssh/<file>.pem
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to <ip> ([<ip>]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Remote: Ignored authorized keys: bad ownership or modes for directory /home/<user>
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Welcome to blah...

密钥的所有权限在实例和连接到实例的机器之间是相同的。

有谁知道可以做些什么来纠正这个问题?

谢谢,-大卫

- 编辑 -

这是仍然不会建立 SSH 连接的工作机器的 -v 调试输出。

我最近还清除了这台机器上的已知主机。

ssh -v -i <path>/<file>.pem <user>@<ip>
OpenSSH_6.0p1 Debian-3ubuntu1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to <ip> [<ip>] port 22.
debug1: Connection established.
debug1: identity file /home/<user>/.ssh/<file>.pem type -1
debug1: identity file /home/<user>/.ssh/<file>.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH_5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1
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 75:43:6d:03:43:f5:89:fa:8d:fe:64:e1:39:9a:73:26
debug1: Host '<ip>' is known and matches the ECDSA host key.
debug1: Found key in /home/<user>/.ssh/known_hosts:1
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
debug1: Next authentication method: publickey
debug1: Trying private key: /home/<user>/.ssh/<file>.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

我想重申,尽管是否可以建立 ssh 连接,但所有转换后的密钥都不适用于 sftp。特别是 .ppk 密钥转换为在 filezilla 中使用。同样,.ppk 适用于除问题子项之外的所有其他实例......并且之前也适用。

--编辑2--

我能够连接的机器重新启动,我无法再连接它。

linux
  • 2 个回答
  • 1129 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