如何在服务器上安装数据中心存储以便用户可以远程访问它?

如何在服务器上安装数据中心存储以便用户可以远程访问它?

我需要在服务器 A 上安装一个存储,以便从服务器 B 可以通过 scp 将文件从 B 发送到 A。

在服务器 A 上,我尝试将存储安装为:

# mount.cifs //u999999.your-storagebox.de/backup /storage/driveNumber -v -o user=u999999,pass=typeUrPasswordHere

挂载结果为:

# ls -la /storage 
total 8
drwxr-xr-x  3 root   root   4096 Feb  2 17:17 .
drwxr-xr-x 23 root   root   4096 Feb  2 17:16 ..
drwxrwxrwx  2 999999 999999    0 Feb  3 17:26 bx20_133060

但是,当我尝试从服务器 B(现在是我的盒子)发送文件时,我得到以下信息:

$ scp -v -p -P 45789 mysql-incremental.tar.gz [email protected]:/storage/bx20_133060
Executing: program /usr/bin/ssh host d2.wearebionic.com, user slammer, command scp -v -p -t /storage/bx20_133060
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to d2.wearebionic.com [136.243.80.14] port 45789.
debug1: Connection established.
debug1: identity file /home/gtl/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/gtl/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to d2.wearebionic.com:45789 as 'slammer'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ue89Au5xEc1UIDcLMwNhTGWuHP7vwJwNHtQbaYo0cUI
debug1: Host '[d2.wearebionic.com]:45789' is known and matches the ECDSA host key.
debug1: Found key in /home/gtl/.ssh/known_hosts:8
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/gtl/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to d2.wearebionic.com ([136.243.80.14]:45789).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_PAPER = en_IE.UTF-8
debug1: Sending env LC_ADDRESS = en_IE.UTF-8
debug1: Sending env LC_MONETARY = en_IE.UTF-8
debug1: Sending env LC_NUMERIC = en_IE.UTF-8
debug1: Sending env LC_TELEPHONE = en_IE.UTF-8
debug1: Sending env LC_IDENTIFICATION = en_IE.UTF-8
debug1: Sending env LANG = en_IE.UTF-8
debug1: Sending env LC_MEASUREMENT = en_IE.UTF-8
debug1: Sending env LC_TIME = pt_BR.UTF-8
debug1: Sending env LC_NAME = en_IE.UTF-8
debug1: Sending command: scp -v -p -t /storage/bx20_133060
File mtime 1485968603 atime 1486140418
Sending file timestamps: T1485968603 0 1486140418 0
Sink: T1485968603 0 1486140418 0
Sending file modes: C0777 75337 mysql-incremental.tar.gz
Sink: C0777 75337 mysql-incremental.tar.gz
scp: /storage/bx20_133060/mysql-incremental.tar.gz: Permission denied
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 3336, received 2708 bytes, in 0.2 seconds
Bytes per second: sent 13686.3, received 11109.9
debug1: Exit status 1

我做错了什么以及如何做对?

答案1

对于只是使用,scp 我首先会直接在服务器 A 和服务器 B 之间验证它,然后将您storagebox排除在外。

从每个服务器尝试类似的事情 scp somefile.txt otherserver:/home/gtludwig/

ssh如果这不起作用,那么问题就更简单了,并且scp与每个服务器之间的安全性有关。

但我怀疑问题在于用户、文件和目录权限在storagebox您要安装的服务器之间没有同步。如果storageboxcifs 是某种存储设备,则尤其如此验证与一些 Windows 域服务器...从技术上讲,这将是服务器 C。还知道 的管理员storagebox可以简单地限制可以安装的设备,storagebox无论用户名和密码是否正确storagebox。这相当于将 linux NFS 导出限制到给定主机,如 中指定的那样/etc/exports

但从您提供的信息看来,发生的情况是您已经storagebox安装了server_A,并且 mount.cifs 是在用户下定向的u999999 ,但是在使用时,scp您在用户下通过 SSH 连接到 Server_A,slammer因此权限被拒绝。

从 Server_A 首先确保storagebox已成功安装,然后作为用户,u999999您可以成功地将文件上传到storagebox.然后尝试scp输入 server_A as u999999,或者确保您使用的用户名/用户 IDscp与用于挂载 cifs 共享的用户名/用户 ID 相同。

相关内容