我有一个Debian 6服务器,它通过ssh脚本运行cd commond。 它始终抛出错误“cd:无法cd到/ home / user /目录/ \错误:无法访问jarfile name.jar”
我检查了权限。他们看起来很好。
我不明白的是,它可以在我的其他三台服务器上运行,并且设置相同。
#!/bin/bash
cd /home/mcgameserver/unhinged/
java -Xmx30M -Xms30M -XX:MaxPermSize=40M -jar Minecraft_RKit.jar
这也不起作用:
DIRECTORY=$(cd "`dirname "$0"`" && pwd)
(cd "$DIRECTORY"; java -Xmx30M -Xms30M -XX:MaxPermSize=40M -jar Minecraft_RKit.jar ${USER}:${PASS})
权限:
Path: /home/mcgameserver/unhinged/
drwxr-xr-x 4 root root 4096 Sep 2 03:18 home
drwxr-xr-x 7 mcgameserver mcgameserver 4096 Sep 2 02:45 mcgameserver
drwxr-xr-x 11 mcgameserver mcgameserver 4096 Sep 2 01:56 unhinged
-rw-r--r-- 1 mcgameserver mcgameserver 342 Sep 2 20:07 rtoolkit.sh
-rw-r--r-- 1 mcgameserver mcgameserver 555336 Sep 2 01:08 Minecraft_RKit.jar
第一个错误的脚本:
mcgameserver@3770-41:~$ sh /home/mcgameserver/unhinged/rtoolkit.sh
: not foundeserver/unhinged/rtoolkit.sh: 2: /home/mcgameserver/unhinged/rtoolkit.sh:
: not foundeserver/unhinged/rtoolkit.sh: 5: /home/mcgameserver/unhinged/rtoolkit.sh:
/home/mcgameserver/unhinged/rtoolkit.sh: 9: cd: can't cd to /home/mcgameserver/unhinged/
Error: Unable to access jarfile Minecraft_RKit.jar
错误第二个脚本:
mcgameserver@3770-41:~$ sh /home/mcgameserver/unhinged/rtoolkit.sh
: not foundeserver/unhinged/rtoolkit.sh: 2: /home/mcgameserver/unhinged/rtoolkit.sh:
: not foundeserver/unhinged/rtoolkit.sh: 5: /home/mcgameserver/unhinged/rtoolkit.sh:
/home/mcgameserver/unhinged/rtoolkit.sh: 8: /home/mcgameserver/unhinged/rtoolkit.sh: Syntax error: word unexpected
在其他3台服务器上运行相同的脚本。它们都是以同样的方式安装的。