V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
cevincheung
V2EX  ›  Linux

关于执行 su - user -c command 的问题。老提示 No passwd entry for user 'user'

  •  
  •   cevincheung ·
    cevin · 2014-04-29 13:52:05 +08:00 · 14493 次点击
    这是一个创建于 3667 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我执行postgresql。

    su - pgsql -c "postmaster -D /opt/pgsqldata" >> /opt/pgsqldata/serverlog 2>&1 &


    提示pgsql没有密码。给pgsql设置了密码。执行su让输入密码。

    怎么在su命令中直接给密码?要不开机无法自动启动啊
    4 条回复    2014-04-29 20:41:44 +08:00
    davepkxxx
        1
    davepkxxx  
       2014-04-29 15:30:38 +08:00
    sudo
    davepkxxx
        2
    davepkxxx  
       2014-04-29 15:31:13 +08:00
    export
    cevincheung
        3
    cevincheung  
    OP
       2014-04-29 19:28:03 +08:00
    @davepkxxx

    解决了 。ubuntu server下,必须切换到root用户执行。sudo也不行。
    kxxoling
        4
    kxxoling  
       2014-04-29 20:41:44 +08:00
    切换到 postgres 用户应该也是可以的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1527 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:05 · PVG 01:05 · LAX 10:05 · JFK 13:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.