我的 ubuntu 机器上安装了多个版本的 postgresql。9.3 是真实的东西。我刚刚安装了 9.4 来做一些复制测试。
这就是为什么我认为我有两个版本正在运行:
test@testdev:/usr/lib/postgresql$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
9.3 main 5432 online postgres /var/lib/postgresql/9.3/main /var/log/postgresql/postgresql-9.3-main.log
9.4 main 5433 online postgres /var/lib/postgresql/9.4/main /var/log/postgresql/postgresql-9.4-main.log
test@testdev:/usr/lib/postgresql$
Run Code Online (Sandbox Code Playgroud)
还:
test@testdev:/usr/lib/postgresql$ ls
9.3 9.4
Run Code Online (Sandbox Code Playgroud)
最后:
test@testdev:~$ /etc/init.d/postgresql stop
* Stopping PostgreSQL 9.3 database server
* Error: You must run this program as the cluster owner (postgres) or root [fail]
* Stopping PostgreSQL 9.4 database server
* Error: You must run this program as the cluster …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 ubuntu 上使用 sshfs。我在尝试连接的服务器上拥有 root 访问权限。但每次我尝试使用我的 ubuntu 笔记本电脑进行连接时,我收到的消息如下:
cp@cp-AOA150:/$ sudo sshfs root@myserver:/ /home/cp/Documents/myserverfolder/
read: Connection reset by peer
cp@cp-AOA150:/$
Run Code Online (Sandbox Code Playgroud)
我对 ubuntu / linux 不太熟悉,但问题可能是服务器上的密钥不是用户“cp”的吗?
如果是这种情况,我如何在 ubuntu 上设置 root 帐户?
任何建议,将不胜感激。
顺便提一句。我可以 ssh 进入盒子没有问题,但作为 root。所以换句话说,这有效:
ssh root@myservername
Run Code Online (Sandbox Code Playgroud)
我已将工作中的密钥文件复制到这台新笔记本电脑上。只是 sshfs 现在不开心。谢谢。
编辑 1
当我使用调试选项运行 sshfs 时:
cp@cp-AOA150:~$ sshfs -o sshfs_debug -p 22 root@10.14.5.182:/ /home/cp/Documents/myserverfolder/
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
SSHFS version 2.4
fusermount: user has no write access to mountpoint /home/cp/Documents/myserverfolder/
cp@cp-AOA150:~$
Run Code Online (Sandbox Code Playgroud)
我已经检查了文件夹 myserverfolder 的权限,它看起来像这样:(ls -la 命令的结果)
drwxr-xr-x 2 root root 4096 Mar 19 17:11 . …Run Code Online (Sandbox Code Playgroud) 我试图弄清楚我安装了哪个版本的python,并将其升级到最新版本。
当我转到命令提示符并检查时,看起来我安装了旧版本的 python。
me@linuxdev:~$ python
Python 2.7.8 (default, Oct 20 2014, 15:05:19)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Run Code Online (Sandbox Code Playgroud)
但是当我在 Ubuntu 中启动软件中心并检查“已安装”部分时,在“开发人员工具”下我看到“Python (v3.4)”条目
所以我不确定我正在运行什么版本。我想要
谢谢。
编辑 1
当我尝试从命令行重新安装 python 时会发生这种情况:
me@linuxdev:~$ sudo apt-get --reinstall python
E: Command line option --reinstall is not understood
Run Code Online (Sandbox Code Playgroud) 我遇到了一个sshfs我以前从未见过的问题。
我通过执行以下操作将 serverB 挂载到 serverA(在 serverA 上以 root 身份登录时):
mkdir serverBLink
sshfs root@serverB:/ /home/myname/Documents/serverBLink
Run Code Online (Sandbox Code Playgroud)
一旦我这样做了,我就可以从命令行通过 serverBLink 文件夹查看 serverB 上的所有文件。照常营业。
但是,我无法在 Ubuntu 上使用文件管理器访问 serverBLink 文件夹。我不知道为什么。我认为这可能是权限问题,因为我在技术上以“dot”的身份登录计算机,但在命令行中,我已切换到 root... ??
作为测试,我尝试chmod 777在 serverBLink 文件夹上运行以授予每个人访问其中所有内容的权限,但它仍然不起作用。
使用文件管理器,当我尝试访问 serverBLink 文件夹时,我收到错误消息:
无法进入文件夹
有什么建议?
server ×2
sshfs ×2
command-line ×1
mount ×1
permissions ×1
postgresql ×1
python ×1
python-2.7 ×1
python3 ×1
ssh ×1