Coder Social home page Coder Social logo

Comments (6)

kslr avatar kslr commented on June 7, 2024

如果这些固定命令的话,直接使用也没有什么区别的吧

from v2ray-step-by-step.

 avatar commented on June 7, 2024
  1. 使用 v2ray 用戶的話:
    # useradd -s /usr/sbin/nologin v2ray
    
    即可,也可直接使用 nobody 用戶。
  2. 這個沒有問題。
  3. 修改為 644 或許可行,使用者擁有讀寫權限,群組和非本群組外的其它人擁有只讀權限。

from v2ray-step-by-step.

djunhao avatar djunhao commented on June 7, 2024
  1. 使用 v2ray 用戶的話:

    # useradd -s /usr/sbin/nologin v2ray
    

    即可,也可直接使用 nobody 用戶。

  2. 這個沒有問題。

  3. 修改為 644 或許可行,使用者擁有讀寫權限,群組和非本群組外的其它人擁有只讀權限。

nobody是系统用户,等同于使用--system创建的用户,是吧?

from v2ray-step-by-step.

 avatar commented on June 7, 2024
  1. 使用 v2ray 用戶的話:

    # useradd -s /usr/sbin/nologin v2ray
    

    即可,也可直接使用 nobody 用戶。

  2. 這個沒有問題。

  3. 修改為 644 或許可行,使用者擁有讀寫權限,群組和非本群組外的其它人擁有只讀權限。

nobody是系统用户,等同于使用--system创建的用户,是吧?

nobody 不是系統賬戶。無需在意是否為系統賬戶,使用 -r, --system,僅會造成 uid、gid 和 groups 的區別。

https://unix.stackexchange.com/questions/80277/whats-the-difference-between-a-normal-user-and-a-system-user

from v2ray-step-by-step.

djunhao avatar djunhao commented on June 7, 2024
  1. 使用 v2ray 用戶的話:

    # useradd -s /usr/sbin/nologin v2ray
    

    即可,也可直接使用 nobody 用戶。

  2. 這個沒有問題。

  3. 修改為 644 或許可行,使用者擁有讀寫權限,群組和非本群組外的其它人擁有只讀權限。

nobody是系统用户,等同于使用--system创建的用户,是吧?

nobody 不是系統賬戶。無需在意是否為系統賬戶,使用 -r, --system,僅會造成 uid、gid 和 groups 的區別。

https://unix.stackexchange.com/questions/80277/whats-the-difference-between-a-normal-user-and-a-system-user

了解了,谢谢!

from v2ray-step-by-step.

phlinhng avatar phlinhng commented on June 7, 2024
  1. 使用腳本生成v2ray.service,可以自動適配不同OS版本的路徑。
ds_service=$(mktemp)
cat > ${ds_service} <<-EOF
[Unit]
Description=V2Ray - A unified platform for anti-censorship
Documentation=https://v2ray.com https://guide.v2fly.org
After=network.target nss-lookup.target
Wants=network-online.target

[Service]
# If the version of systemd is 240 or above, then uncommenting Type=exec and commenting out Type=simple
#Type=exec
Type=simple
# Runs as root or add CAP_NET_BIND_SERVICE ability can bind 1 to 1024 port.
# This service runs as root. You may consider to run it as another user for security concerns.
# By uncommenting User=v2ray and commenting out User=root, the service will run as user v2ray.
# More discussion at https://github.com/v2ray/v2ray-core/issues/1011
#User=root
User=v2ray
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_RAW
NoNewPrivileges=yes

ExecStartPre=$(which mkdir) -p /tmp/v2ray-ds
ExecStartPre=$(which rm) -rf /tmp/v2ray-ds/*.sock

ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json

ExecStartPost=$(which sleep) 1
ExecStartPost=$(which chmod) 777 /tmp/v2ray-ds/v2ray.sock

Restart=on-failure
# Don't restart in the case of configuration error
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target
EOF
# add new user and overwrite v2ray.service
# https://github.com/v2ray/v2ray-core/issues/1011
useradd -d /etc/v2ray/ -M -s /sbin/nologin v2ray
mv ${ds_service} /etc/systemd/system/v2ray.service
chown -R v2ray:v2ray /var/log/v2ray
  1. 試過將權限改成644,會導致TLS分流器沒有辦法讀寫/tmp/v2ray-ds/v2ray.sock

from v2ray-step-by-step.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.