Discussion:
su makes not proper root
Zoran Kolic
2014-09-27 05:37:31 UTC
Permalink
On raspberry pi I installed 7.99 and use
su to get root. At first, I spoted that,
during shutdown, message says it came from
***@localhost. I expected ***@localhost.
Now, I have a lot of problems configuring
mail app. I could send mail outbound via
sender_canonical_maps, send from root to
user correctly. If I send from user to root,
it goes to /var/mail/root file, but mail
tries to read /var/mail/user file. I might
change it with "folder /var/mail/root" and
read as I should.
I'm puzzled how su on netbsd works. Have I
made a mistake or it is normal behaveour?
If normal, how to set /var/mail/root, since
.mailrc > "set folder=/var/mail/root" does
not work.
One thing to stress. I login as user via ssh.
The only option to get root is su, obviously.
Best regards

Zoran
Valery Ushakov
2014-09-27 10:49:54 UTC
Permalink
but mail tries to read /var/mail/user file. I might change it with
"folder /var/mail/root" and read as I should. I'm puzzled how su on
netbsd works. Have I made a mistake or it is normal behaveour?
su -

(also -l or -d)

-uwe
Terho Uotila
2014-09-29 16:20:32 UTC
Permalink
On Sat, 27 Sep 2014 07:37:31 +0200
Post by Zoran Kolic
On raspberry pi I installed 7.99 and use
su to get root. At first, I spoted that,
during shutdown, message says it came from
NetBSD su remembers your login id, unlike su used in some other OS.
Try id -p as root to see this.

If system has several admins, login id in shutdown message is probably
more informative, and even with only one admin I think it doesn't do
any harm.
Post by Zoran Kolic
Now, I have a lot of problems configuring
mail app. I could send mail outbound via
sender_canonical_maps, send from root to
user correctly. If I send from user to root,
it goes to /var/mail/root file, but mail
tries to read /var/mail/user file. I might
change it with "folder /var/mail/root" and
read as I should.
I redirect my root mail to main user address using /etc/mail/aliases
(if that helps)

IIRC, you can also use -f to read any mailbox you can access (mail -f
/path/to/mbox).
Zoran Kolic
2014-09-29 16:27:17 UTC
Permalink
Post by Terho Uotila
NetBSD su remembers your login id, unlike su used in some other OS.
Try id -p as root to see this.
I got answer with "su -" as the solution. Still it says
Post by Terho Uotila
I redirect my root mail to main user address using /etc/mail/aliases
(if that helps)
su - was proper for my complaint. I forgot to reread
man page, since I had wrong impression I remembered
it from eons ago. My bad.

With - I get proper path to /var/mail/root. Exactelly
what was needed. :)

Thank you for answer and best regards

Zoran
Dan LaBell
2014-10-02 09:00:33 UTC
Permalink
Post by Terho Uotila
On Sat, 27 Sep 2014 07:37:31 +0200
Post by Zoran Kolic
On raspberry pi I installed 7.99 and use
su to get root. At first, I spoted that,
during shutdown, message says it came from
NetBSD su remembers your login id, unlike su used in some other OS.
Try id -p as root to see this.
Just thought I'd add, that it adds SU_FROM to environment .

Loading...