如何通过 Telnet 在 OpenDreambox 中安装 Windows 共享?

如何通过 Telnet 在 OpenDreambox 中安装 Windows 共享?

我在 C 盘根目录创建了一个名为的新文件夹录音我已经与大家分享了。我现在想将此文件夹安装到我的 Dreambox 上,以便我可以在其中录音。

但由于这是带有 Enigma2 的原装 Dream Multimedia 盒子,所以我没有其他选择网络浏览器或者安装管理器在网络设置菜单中,所以我无法通过菜单轻松完成此操作,除非更改 Dreambox 的图像。

我读到过可以通过 Telnet 安装它。那么我该怎么做呢?我该使用哪个或哪些命令?

我在网上找到了这两个命令:

示例 1:

mount –t cifs –o username=name,password=password //192.168.1.10/dreambox

示例 2:

mount -t smbfs -o username=YourUserName //x.x.x.x/YourShareName /your/mountpoint

我可以使用这两个命令中的任何一个吗?为什么它cifs在一个命令中说smbfs,在另一个命令中说?这些开关是什么意思?此外,我每次重启时都必须这样做吗?还是这是一个永久设置?

我使用 PuTTYtel 连接到 Dreambox,它显示为 OpenDreambox 1.6.0。

更新:这是 PuTTYtel 中 PS 命令的输出。

OpenDreambox 1.6.0 dm500hd

dm500hd login: root
root@dm500hd:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1724 S    init [3]
    2 root         0 SW   [migration/0]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW   [migration/1]
    5 root         0 SWN  [ksoftirqd/1]
    6 root         0 SW<  [events/0]
    7 root         0 SW<  [events/1]
    8 root         0 SW<  [khelper]
    9 root         0 SW<  [kthread]
   10 root         0 SW<  [kblockd/0]
   11 root         0 SW<  [kblockd/1]
   12 root         0 SW<  [khubd]
   13 root         0 SW   [pdflush]
   14 root         0 SW   [pdflush]
   15 root         0 SW<  [kswapd0]
   16 root         0 SW<  [aio/0]
   17 root         0 SW<  [aio/1]
   18 root         0 SW<  [ata/0]
   19 root         0 SW<  [ata/1]
   20 root         0 SW<  [ata_aux]
   21 root         0 SW<  [scsi_eh_0]
   22 root         0 SW<  [scsi_eh_1]
   23 root         0 SW   [mtdblockd]
   24 root         0 SWN  [jffs2_gcd_mtd3]
   70 root      2180 S <  udevd --daemon
  310 root         0 SW   [b_event]
  311 root         0 SW   [b_idle]
  317 root         0 SW<  [fp]
  339 root         0 SW<  [dmx0]
  345 root         0 SW<  [dmx1]
  354 root         0 SW<  [dmx2]
  355 root         0 SW<  [dmx_hw_sec]
  391 messageb  2408 S    /usr/bin/dbus-daemon --system
  394 root      1928 S    /usr/bin/wdog tpmd
  395 root      4312 S    tpmd
  398 root      1928 S    /usr/bin/wdog dccamd -
  399 root      3136 S    dccamd -
  408 avahi     3084 S    avahi-daemon: running [dm500hd.local]
  441 root      4076 S    nmbd -D
  443 root      6780 S    smbd -D
  458 root      6780 S    smbd -D
  465 root      2504 S    udhcpc -R -b -T3 -A10 -p /var/run/udhcpc.eth0.pid -i
  477 root      1712 S    /usr/sbin/zeroconf -i eth0
  493 root      2348 S    /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host
  496 root      1832 S    /usr/sbin/inetd
  499 root      2504 S    /sbin/syslogd -n -O /var/log/messages -s 32 -b 1 -m 2
  501 root      2504 S    /sbin/klogd -n
  614 root      2256 S    /usr/sbin/automount --pid-file=/var/run/autofs/_autof
  675 root      2504 S    /bin/sh /usr/bin/enigma2.sh
  678 root     65104 S    /usr/bin/enigma2
  687 root     65104 S    /usr/bin/enigma2
  709 root     65104 S    /usr/bin/enigma2
  717 root     65104 S N  /usr/bin/enigma2
22611 root      2824 S    telnetd
22612 root      2820 S    -sh
22737 root      2820 R    ps
root@dm500hd:~#

更新:我显然已经有了/media 文件夹。

root@dm500hd:/# cd /media
root@dm500hd:/media# cd /share
root@dm500hd:/usr/share#

当我尝试时,cd/share会重定向到/usr/share。那么我可以使用此文件夹而不是创建新文件夹吗?...

更新:我现在已经做出了新的尝试......

root@dm500hd:/# sudo mkdir /newfolder/share
-sh: sudo: not found
root@dm500hd:/# $ sudo mkdir /newfolder/share
-sh: $: not found
root@dm500hd:/# $sudo mkdir /newfolder/share
mkdir: cannot create directory '/newfolder/share': No such file or directory
root@dm500hd:/# $sudo mkdir /media/share
root@dm500hd:/# $sudo chmod a+r /media/share
root@dm500hd:/# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
root@dm500hd:/# edit /etc/fstab
-sh: edit: not found
root@dm500hd:/# edit /etc/fstab
-sh: edit: not found
root@dm500hd:/# open /etc/fstab
-sh: open: not found
root@dm500hd:/#

所以我需要添加美元符号?中间没有空格?这次看起来成功了……我首先尝试创建一个名为新建文件夹。为什么它拒绝了?然后我创建了/media/share 文件夹……这对现有的分享之前存在的符号链接(或任何其他东西)?

shBourne shell 还是 Thompson shell?还是所有 Linux shellsh都缩写为 Ash shell?

如何在 shell 中编辑文件?我必须fstab在 Windows 上下载并编辑它,然后通过 FTP 将其发回。

然后我尝试了一下$sudo mount -a,结果给了我这个:

root@dm500hd:/# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //192.168.0.107/recordings on /media/share failed: No such device
root@dm500hd:/#

这是我的 fstab 文件的内容:

rootfs               /                    auto       defaults              1 1
proc                 /proc                proc       defaults              0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
usbfs                /proc/bus/usb        usbfs      defaults              0 0
/dev/mtdblock2       /boot                jffs2      ro                    0 0
tmpfs                /var                 tmpfs      defaults              0 0
tmpfs                /tmp                 tmpfs      defaults              0 0
/dev/sda1            /media/hdd           auto       defaults              0 0
//192.168.0.107/recordings /media/share smbfs auto,user=classified,password=classfied 0 0

我将尝试重新启动该盒子并查看它是否有效。

更新:还是没有运气...

它仍然给我mount: mounting //192.168.0.107/recordings on /media/share failed: No such device。我尝试用计算机名称替换 IP,但它给了我相同的消息。

我甚至尝试过反转 fstab 中术语的顺序(以防万一是语法问题),以便我首先获得 /media/share。它给了我mount: mounting /media/share on /computername/recordings failed: No such file or directory

更新:我很幸运...

为什么你坚持要挂载到/media/share?这是惯例吗?我可以挂载到另一个文件夹吗?我通过在 Windows 中创建一个新文件夹和一个新共享,然后使用mount -t cifs命令解决了这个问题。

OpenDreambox 1.6.0 dm500hd


dm500hd login: root
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //192.168.0.107/recordings on /media/share failed: No such device

我认为/dev/sda1 on /media/hdd failed部分原因是没有连接磁盘驱动器。此 STB 可以在 eSATA 端口上连接 HDD,但目前没有连接。

我认为显示第二行是因为 IP 错误。我认为它应该是 192.168.0.101,而 192.168.0.107 是我尝试安装的 STB 盒的名称。

root@dm500hd:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1724 S    init [3]
    2 root         0 SW   [migration/0]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW   [migration/1]
    5 root         0 SWN  [ksoftirqd/1]
    6 root         0 SW<  [events/0]
    7 root         0 SW<  [events/1]
    8 root         0 SW<  [khelper]
    9 root         0 SW<  [kthread]
   10 root         0 SW<  [kblockd/0]
   11 root         0 SW<  [kblockd/1]
   12 root         0 SW<  [khubd]
   13 root         0 SW   [pdflush]
   14 root         0 SW   [pdflush]
   15 root         0 SW<  [kswapd0]
   16 root         0 SW<  [aio/0]
   17 root         0 SW<  [aio/1]
   18 root         0 SW<  [ata/0]
   19 root         0 SW<  [ata/1]
   20 root         0 SW<  [ata_aux]
   21 root         0 SW<  [scsi_eh_0]
   22 root         0 SW<  [scsi_eh_1]
   23 root         0 SW   [mtdblockd]
   24 root         0 SWN  [jffs2_gcd_mtd3]
   70 root      2180 S <  udevd --daemon
  313 root         0 SW   [b_event]
  314 root         0 SW   [b_idle]
  320 root         0 SW<  [fp]
  344 root         0 SW<  [dmx0]
  351 root         0 SW<  [dmx1]
  359 root         0 SW<  [dmx2]
  360 root         0 SW<  [dmx_hw_sec]
  396 messageb  2408 S    /usr/bin/dbus-daemon --system
  399 root      1928 S    /usr/bin/wdog tpmd
  400 root      4312 S    tpmd
  403 root      1928 S    /usr/bin/wdog dccamd -
  404 root      3136 S    dccamd -
  413 avahi     3084 S    avahi-daemon: running [dm500hd.local]
  451 root      4076 S    nmbd -D
  453 root      6780 S    smbd -D
  473 root      6780 S    smbd -D
  489 root      2504 S    udhcpc -R -b -T3 -A10 -p /var/run/udhcpc.eth0.pid -i
  503 root      1712 S    /usr/sbin/zeroconf -i eth0
  519 root      2348 S    /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host
  522 root      1832 S    /usr/sbin/inetd
  525 root      2504 S    /sbin/syslogd -n -O /var/log/messages -s 32 -b 1 -m 2
  527 root      2504 S    /sbin/klogd -n
  640 root      2256 S    /usr/sbin/automount --pid-file=/var/run/autofs/_autof
  701 root      2504 S    /bin/sh /usr/bin/enigma2.sh
  704 root     84536 S    /usr/bin/enigma2
  713 root     84536 S    /usr/bin/enigma2
  735 root     84536 S    /usr/bin/enigma2
  748 root     84536 S N  /usr/bin/enigma2
  739 root         0 SW<  [kdvb-ad-0-fe-0]
  886 root      7324 S    smbd -D
  965 root      2824 S    telnetd
  966 root      2820 S    -sh
 1063 nobody    2292 S    vsftpd
 1065 root      2316 S    vsftpd
 1076 root      2820 R    ps
root@dm500hd:~# smbd
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting /computername/recordings on /media/share failed: No such device

在最后一行中,我尝试使用计算机的网络名称,而不是文件系统文件。但这没有帮助……也许它必须是一个 IP,而不是网络名称?……不知道……

root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting /media/share on /computername/recordings failed: No such file or directory
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //media/share on /computername/recordings failed: No such file or directory
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //media/share on /computername/recordings failed: No such file or directory
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //computername/recordings on /media/share failed: No such device

我尝试以不同的方式编辑和更新 fstab 文件,例如添加额外的空格...我想以防万一这是一个格式化的问题......

这是为我提供有效解决方案的部分:

我创建了一个名为梦想盒子在 Windows 机器的 C 盘下,并与每个人groupe。然后我执行了下面的命令。

root@dm500hd:~# cd /
root@dm500hd:/# mkdir
BusyBox v1.15.3 (2010-10-14 16:48:44 UTC) multi-call binary

Usage: mkdir [OPTIONS] DIRECTORY...

Create DIRECTORY

Options:
        -m      Set permission mode (as in chmod), not rwxrwxrwx - umask
        -p      No error if existing, make parent directories as needed

root@dm500hd:/# /hdd/movie
-sh: /hdd/movie: not found
root@dm500hd:/# mkdir /hdd/movie

The /hdd is a syslink (symbolic link) I think so it is really located at `/media/hdd`. Note that this is the same location where `/dev/sda1` is mounted.

root@dm500hd:/# mount -t cifs -o username=user,password=pass //192.168.0.10
7/dreambox /hdd
mount: mounting //192.168.0.107/dreambox on /hdd failed: No such device or address
root@dm500hd:/# mount cifs user=user,password=pass //192.168.0.101/dreambox /hdd

192.168.0.107 是 STB 盒的 IP,所以这是错误的。共享托管 Windows 机器的正确 IP 是 192.168.0.101。另外,它是“用户名”而不是“用户”。

这是输出:

BusyBox v1.15.3 (2010-10-14 16:48:44 UTC) multi-call binary

Usage: mount [flags] DEVICE NODE [-o OPT,OPT]

Mount a filesystem. Filesystem autodetection requires /proc be mounted.

Options:
        -a              Mount all filesystems in fstab
        -r              Read-only mount
        -w              Read-write mount (default)
        -t FSTYPE       Filesystem type
        -O OPT          Mount only filesystems with option OPT (-a only)
-o OPT:
        loop            Ignored (loop devices are autodetected)
        [a]sync         Writes are [a]synchronous
        [no]atime       Disable/enable updates to inode access times
        [no]diratime    Disable/enable atime updates to directories
        [no]relatime    Disable/enable atime updates relative to modification time
        [no]dev         (Dis)allow use of special device files
        [no]exec        (Dis)allow use of executable files
        [no]suid        (Dis)allow set-user-id-root programs
        [r]shared       Convert [recursively] to a shared subtree
        [r]slave        Convert [recursively] to a slave subtree
        [r]private      Convert [recursively] to a private subtree
        [un]bindable    Make mount point [un]able to be bind mounted
        bind            Bind a directory to an additional location
        move            Relocate an existing mount point
        remount         Remount a mounted filesystem, changing its flags
        ro/rw           Read-only/read-write mount

There are EVEN MORE flags that are specific to each filesystem
You'll have to see the written documentation for those filesystems

如您所见,这是错误的语法。必须使用其中一个选项。

root@dm500hd:/# mount -t cifs -o username=user,password=pass //192.168.0.10
1/dreambox /hdd
root@dm500hd:/# mount -a
mount: mounting //computername/recordings on /media/share failed: No such device

最后一行是因为我仍然在 fstab 文件中添加了该行。编辑 fstab 文件并删除我之前添加的此行后,此mount -t cifs命令生效。

root@dm500hd:/# mount -a
root@dm500hd:/# $sudo mount -a
root@dm500hd:/#

mount -a请注意,当我执行或 时没有错误输出sudo mount -a

我遵循了以下指南:http://www.maxteknik.se/forum/viewtopic.php?t=3828

答案1

最简单的方法是使用 SMB 协议。在您的 Linux 机器上,为共享文件夹创建挂载点:

$ sudo mkdir /media/share
$ sudo chmod a+xr /media/share

第二条命令将 /media/share/directory 设置为可读和可执行(意味着用户可以进入该目录),方法是全部用户。

在 *ix 系统上,安装驱动器(本地或远程)的设置在文件中设置etc/fstab。该文件的一般格式为:

DRIVE  LOCAL_MOUNT_DIRECTORY FILESYSTEM OPTIONS    


在你的 Linux 机器上编辑/etc/fstab并添加以下行:

//x.x.x.x/recordings /media/share smbfs auto,user=USER,password=PASS 0 0

更改x.x.x.x./YouShareName为显示您的 Windows 服务器的 IP 并正确设置 USER 和 PASS。如果一切顺利,它应该可以工作,并将在 (linux) 系统重新启动时安装。要在不重新启动的情况下进行测试,请运行:

$ sudo mount -a

有关详细信息和更详细的操作方法,请参阅这里

相关内容