通过 SSH 连接时无法推送 git 更新和 运行 Unix 命令
Can't push git updates & run Unix commands when connecting via SSH
我已经在我的 bluehost VPS 上安装了 java 8。我已关注 http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
指示 。
为了将目录添加到 PATH
变量,我添加了
PATH=$PATH:/opt/jdk1.8.0_45/bin:/opt/jdk1.8.0_45/jre/bin
JAVA_HOME=/opt/jdk1.8.0_45
JRE_HOME=/opt/jdk1.8.0_45/jre
到 etc/environment
文件。
之后我无法将升级推送到我的 git 存储库,当我通过 ssh 登录时我无法 运行 unix 命令。
我的服务器OS是CentOS及其64位
感谢您的帮助。
编辑:
git 中显示的错误:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to root@162.144.42.157:/home/darmanjo/darmanjoo.git
bash: git-receive-pack: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
SSH 问题:
login as: root
root@162.144.42.157's password:
Last login: Tue Apr 21 15:26:53 2015 from 109-110-182-162-dynamic.shabdiznet.com
-bash: id: command not found
-bash: tty: command not found
root@server.darmanjoo.com [~]# ls
-bash: ls: command not found
root@server.darmanjoo.com [~]#
我的 echo $PATH
也显示:
/usr/local/sbin:/usr/sbin:/sbin:$PATH:/opt/jdk1.8.0_45/bin:/opt/jdk1.8.0_45/jre/bin:/root/bin
该页面不正确。
这些分配行在 /etc/environment
中无效。
/etc/environment
.
中的行不会发生变量扩展
有关此问题的更多讨论,请参阅 this superuser question。
我已经在我的 bluehost VPS 上安装了 java 8。我已关注 http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/ 指示 。
为了将目录添加到 PATH
变量,我添加了
PATH=$PATH:/opt/jdk1.8.0_45/bin:/opt/jdk1.8.0_45/jre/bin
JAVA_HOME=/opt/jdk1.8.0_45
JRE_HOME=/opt/jdk1.8.0_45/jre
到 etc/environment
文件。
之后我无法将升级推送到我的 git 存储库,当我通过 ssh 登录时我无法 运行 unix 命令。
我的服务器OS是CentOS及其64位
感谢您的帮助。
编辑:
git 中显示的错误:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to root@162.144.42.157:/home/darmanjo/darmanjoo.git
bash: git-receive-pack: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
SSH 问题:
login as: root
root@162.144.42.157's password:
Last login: Tue Apr 21 15:26:53 2015 from 109-110-182-162-dynamic.shabdiznet.com
-bash: id: command not found
-bash: tty: command not found
root@server.darmanjoo.com [~]# ls
-bash: ls: command not found
root@server.darmanjoo.com [~]#
我的 echo $PATH
也显示:
/usr/local/sbin:/usr/sbin:/sbin:$PATH:/opt/jdk1.8.0_45/bin:/opt/jdk1.8.0_45/jre/bin:/root/bin
该页面不正确。
这些分配行在 /etc/environment
中无效。
/etc/environment
.
有关此问题的更多讨论,请参阅 this superuser question。