news account without user
Hello, I'm trying to install INN, the nntp server on openSUSE 15.3 I am root on this system, and log as root with ssh key. INN is available from yast, so not problem installing the binaries. But... INN installs itself as user "news". The "news" folder is available with cd ~news, and is physically setup in /etc/news. this user is a system user and not allowed to login. however, some commands are better used as user news. What is the best way to achieve this? runuser don't works ("no account"). may I allow login? I could give a very long random password to prevent other login than root thanks jdd -- http://dodin.org https://valeriedodin.com
On 10/10/2021 12.31, jdd@dodin.org wrote:
Hello,
I'm trying to install INN, the nntp server on openSUSE 15.3
I am root on this system, and log as root with ssh key.
INN is available from yast, so not problem installing the binaries. But...
INN installs itself as user "news". The "news" folder is available with cd ~news, and is physically setup in /etc/news.
this user is a system user and not allowed to login.
however, some commands are better used as user news.
What is the best way to achieve this?
runuser don't works ("no account").
may I allow login? I could give a very long random password to prevent other login than root
I saw no other way than to allow login. This instant I don't remember if this procedure works: su - su - news -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
Le 10/10/2021 à 12:42, Carlos E. R. a écrit :
su - news
say: # su - news This account is currently not available. but, thinking... /etc/shadow contain news:!:(...) Am I right saying than the "!" mean no login is allowed with a password? in fact, I ask because in Yast, in the system user news account, there are "****" in the password field. But may be these are only place holders... so may be I can remove the "nologin", but keep using no passwd. like this I could go to user news account and identity with su - from root, add a ssh rsa key and then log in the ~news account with the corresponding ssh key? thanks jdd -- http://dodin.org https://valeriedodin.com
W dniu 10.10.2021 o 12:31, jdd@dodin.org pisze:
Hello,
I'm trying to install INN, the nntp server on openSUSE 15.3
I am root on this system, and log as root with ssh key.
INN is available from yast, so not problem installing the binaries. But...
INN installs itself as user "news". The "news" folder is available with cd ~news, and is physically setup in /etc/news.
this user is a system user and not allowed to login.
however, some commands are better used as user news.
What is the best way to achieve this?
runuser don't works ("no account").
may I allow login? I could give a very long random password to prevent other login than root
thanks jdd
If you're already logged as root: sudo -u news -s /bin/bash command
Le 10/10/2021 à 12:55, Adam Mizerski a écrit :
sudo -u news -s /bin/bash command
# LANG=US ; sudo -u news -s /bin/bash ls /usr/bin/ls: /usr/bin/ls: cannot execute binary file :-( thanks jdd -- http://dodin.org https://valeriedodin.com
W dniu 10.10.2021 o 13:18, jdd@dodin.org pisze:
Le 10/10/2021 à 12:55, Adam Mizerski a écrit :
sudo -u news -s /bin/bash command
# LANG=US ; sudo -u news -s /bin/bash ls /usr/bin/ls: /usr/bin/ls: cannot execute binary file
:-( thanks jdd
Interesting. I reproduced this locally, but I have no idea why it doesn't work like that. But what definitely works is "sudo -u news -s /bin/bash". It will give you interactive shell.
Le 10/10/2021 à 13:24, Adam Mizerski a écrit :
But what definitely works is "sudo -u news -s /bin/bash". It will give you interactive shell.
ok, very good, it's really the simpler solution. thanks!! jdd -- http://dodin.org https://valeriedodin.com
On Sun, 10 Oct 2021 13:18:06 +0200
"jdd@dodin.org"
Le 10/10/2021 à 12:55, Adam Mizerski a écrit :
sudo -u news -s /bin/bash command
# LANG=US ; sudo -u news -s /bin/bash ls /usr/bin/ls: /usr/bin/ls: cannot execute binary file
There's a -c missing. (ls is not a script file so bash won't run it as one). Try # LANG=US ; sudo -u news -s /bin/bash -c ls
:-( thanks jdd
Le 10/10/2021 à 13:31, Dave Howorth a écrit :
On Sun, 10 Oct 2021 13:18:06 +0200 "jdd@dodin.org"
wrote: Le 10/10/2021 à 12:55, Adam Mizerski a écrit :
sudo -u news -s /bin/bash command
# LANG=US ; sudo -u news -s /bin/bash ls /usr/bin/ls: /usr/bin/ls: cannot execute binary file
There's a -c missing. (ls is not a script file so bash won't run it as one). Try
# LANG=US ; sudo -u news -s /bin/bash -c ls
ok, thanks still learning at 75' :-) jdd -- http://dodin.org https://valeriedodin.com
jdd@dodin.org wrote:
Hello,
I'm trying to install INN, the nntp server on openSUSE 15.3
I am root on this system, and log as root with ssh key.
INN is available from yast, so not problem installing the binaries. But...
INN installs itself as user "news". The "news" folder is available with cd ~news, and is physically setup in /etc/news.
this user is a system user and not allowed to login.
however, some commands are better used as user news.
What is the best way to achieve this?
How about "su -s /bin/sh news" (as root) ? -- Per Jessen, Zürich (6.1°C)
Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt) #sudo -u news -s /bin/bash news@ns507557:/root> exit news@ns507557:/root> whoami news ns507557:~ # su -s /bin/sh news sh-4.4$ sh-4.4$ whoami news jdd -- http://dodin.org https://valeriedodin.com
On Mon, Oct 11, 2021 at 12:55 PM jdd@dodin.org
Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt)
Why do you expect bash and sh to have the same prompt?
#sudo -u news -s /bin/bash news@ns507557:/root> exit
news@ns507557:/root> whoami news
ns507557:~ # su -s /bin/sh news sh-4.4$
sh-4.4$ whoami news
On 11/10/2021 12.11, Andrei Borzenkov wrote:
On Mon, Oct 11, 2021 at 12:55 PM jdd@dodin.org
wrote: Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt)
Why do you expect bash and sh to have the same prompt?
Perhaps because /bin/sh is a symlink to bash? But he is using sudo once and su another time. I can not verify because on my machine user "news" can login. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On Mon, 11 Oct 2021 11:51:43 +0200
"jdd@dodin.org"
Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt)
#sudo -u news -s /bin/bash news@ns507557:/root> exit
news@ns507557:/root> whoami news
ns507557:~ # su -s /bin/sh news sh-4.4$
sh-4.4$ whoami news
It knows whether it was invoked as 'sh' or 'bash' and presumably doesn't read bash-specific config files when invoked as 'sh'.
jdd
jdd@dodin.org wrote:
Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt)
#sudo -u news -s /bin/bash news@ns507557:/root> exit
news@ns507557:/root> whoami news
ns507557:~ # su -s /bin/sh news sh-4.4$
Uh, try "su -s /bin/sh --login news" It's the same as "su -s /bin/sh - news" -- Per Jessen, Zürich (9.9°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland.
Le 11/10/2021 à 12:22, Per Jessen a écrit :
jdd@dodin.org wrote:
Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt)
#sudo -u news -s /bin/bash news@ns507557:/root> exit
news@ns507557:/root> whoami news
ns507557:~ # su -s /bin/sh news sh-4.4$
Uh, try "su -s /bin/sh --login news"
It's the same as "su -s /bin/sh - news"
yes thanks you all, I can do what I need and wont go more deep in details mush too hard for my head :-) jdd -- http://dodin.org https://valeriedodin.com
participants (6)
-
Adam Mizerski
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Howorth
-
jdd@dodin.org
-
Per Jessen