如何使用nologin用户执行命令

nologin 用户执行命令

[root@node1 ~]# ls -al /tmp/qemu-user-test
ls: cannot access '/tmp/qemu-user-test': No such file or directory

[root@node1 ~]# su -s /bin/bash -c 'echo "i am nologin user." > /tmp/qemu-user-test' qemu

[root@node1 ~]# ls -al /tmp/qemu-user-test
-rw-r--r-- 1 qemu qemu 19 Jan 31 11:29 /tmp/qemu-user-test

[root@node1 ~]# cat /tmp/qemu-user-test
i am nologin user.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.