Comments (6)
你好,goauthing@<username>.service
不是通过 systemctl --user
激活的(@NickCao 打的包倒确实是这样激活的,@ouuan 的不是)
正确的激活方式是在 root 用户下 systemctl start goauthing@<username>
另外,如果需要开机即激活并定时认证,可以在 root 用户下
systemctl enable --now goauthing@<username>.timer
我的 timer 样例如下,我似乎忘了 commit 上来……
[Unit]
[Timer]
OnBootSec=60
OnUnitActiveSec=2min
#OnCalendar=hourly
[Install]
WantedBy=timers.target
from goauthing.
非常感谢您的解答。使用sudo systemctl start/enable
确实可以正常运行,但是我还有一些疑问:
auth-thu-bin这个包将一系列goauthing.serivce
放在了/usr/lib/systemd/user/
,这一目录是用来放用户单元文件的,用systemctl --user
管理的,而用系统级的systemctl
是找不到这一文件的。我是将这一文件拷贝到/etc/systemd/system/
中才可以运行的。所以有没有可能是维护者打包打错了啊?
还有就是用系统权限去执行网络验证权限好像有点太高了,这对于个人电脑当然无所谓,但是多用户不知root密码就会很麻烦。尤其是goauthing@<username>.service
加了@参数很明显就是想让单个用户去执行的。
from goauthing.
auth-thu-bin这个包将一系列
goauthing.serivce
放在了/usr/lib/systemd/user/
,这一目录是用来放用户单元文件的,用systemctl --user
管理的,而用系统级的systemctl
是找不到这一文件的。我是将这一文件拷贝到/etc/systemd/system/
中才可以运行的。所以有没有可能是维护者打包打错了啊?
很可能是的,我自己没有在用这些 service,直接看的 auth-thu 是放在 /usr/lib/systemd/user
就放了。这个应该是要怎么放呢 /etc/systemd/system
吗
from goauthing.
较为安全的做法是将 unit file 置于 /usr/lib/systemd/user/
,此时由于本身已经是 user unit,也无需使用template unit (即@<用户名>) 这一方式。不过这一做法有一个缺陷是在默认情况下,user unit 并不会随着系统的启动而启动,但是可以通过 loginctl enable-linger
开启这一行为。
from goauthing.
很可能是的,我自己没有在用这些 service,直接看的 auth-thu 是放在
/usr/lib/systemd/user
就放了。这个应该是要怎么放呢 全放/etc/systemd/system
吗
用户自己加系统服务是放在 /etc/systemd/system
的,打成包的话是放在 /usr/lib/systemd/system
的。
不过这一做法有一个缺陷是在默认情况下,user unit 并不会随着系统的启动而启动,但是可以通过
loginctl enable-linger
开启这一行为。
这几个 service 是为了开机自认证而服务的(虽然我没扔进来 timer)。既然 loginctl enable-linger
需要 root,那放在 user
然后给用户开机自启和放在 system
然后降格为各个用户所需要的权限是一样的。
多用户的情景中,如果系统管理员知道 auth-thu 然后安装了,如果只有一个管理员,这时候一般会让系统管理员自己配置认证,毕竟密码是明文存放的,其他用户存放密码并不安全。
如果系统管理员不知道,没有 root 权限的用户登录以后自己需要认证,为了方便可以将服务放在 ~/.config/systemd/user/
,这时候就需要用户自己修改 service 了(因为二进制路径各不相同)。
在多管理员或用户没有权限的情景下,我们也不推荐使用 service,因为这需要填写 ~/.auth-thu
,而(其他)系统管理员能读取到该文件,所以这时我们推荐用户手动调用 auth-thu。
from goauthing.
大概明白了,感谢各位的耐心解答。
之前只会用别人的service文件,自己没有写过调过,看来还是要多加学习。
from goauthing.
Related Issues (13)
- failed to auth (auth4.tsinghua.edu.cn) IP地址异常,请重新拿地址 HOT 17
- IP地址异常,请重新拿地址
- 请问用这个登录校园网后,还会不会掉线 HOT 2
- 有IP地址但是无法连接认证界面 HOT 3
- 为什么没有认证,外面的网络可以 ping 通我的 IP 呢? HOT 1
- Support net.tsinghua.edu.cn HOT 4
- 预编译的二进制文件不能正常工作 HOT 1
- Questions on contribution HOT 1
- How to run the prebuilt binary on macOS HOT 3
- 命令行认证报错 HOT 1
- Support auto auth HOT 3
- `auth -o` would deauthenticate all clients HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goauthing.