Why is 'logger' always executed as the same user?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I'm using rsyslog 8.24
on debian. Each time I trigger logger "some message"
the syslog refers to the same and only system user - it does not matter if I switch user (even as root
), the messages are always logged as the same user - even on servers - I guess on a desktop, it's because the GUI is running as that user and on a server because I logged in as that user and later switch to root
- could that be? But anyway, how could I log a message as root
to the syslog?
debian syslog rsyslog
add a comment |Â
up vote
0
down vote
favorite
I'm using rsyslog 8.24
on debian. Each time I trigger logger "some message"
the syslog refers to the same and only system user - it does not matter if I switch user (even as root
), the messages are always logged as the same user - even on servers - I guess on a desktop, it's because the GUI is running as that user and on a server because I logged in as that user and later switch to root
- could that be? But anyway, how could I log a message as root
to the syslog?
debian syslog rsyslog
What is the user thatlogger
logs?
â Kusalananda
Aug 3 at 16:22
It's my default system user I use to login to X11 or SSH on servers.
â chevallier
Aug 3 at 16:26
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm using rsyslog 8.24
on debian. Each time I trigger logger "some message"
the syslog refers to the same and only system user - it does not matter if I switch user (even as root
), the messages are always logged as the same user - even on servers - I guess on a desktop, it's because the GUI is running as that user and on a server because I logged in as that user and later switch to root
- could that be? But anyway, how could I log a message as root
to the syslog?
debian syslog rsyslog
I'm using rsyslog 8.24
on debian. Each time I trigger logger "some message"
the syslog refers to the same and only system user - it does not matter if I switch user (even as root
), the messages are always logged as the same user - even on servers - I guess on a desktop, it's because the GUI is running as that user and on a server because I logged in as that user and later switch to root
- could that be? But anyway, how could I log a message as root
to the syslog?
debian syslog rsyslog
asked Aug 3 at 15:57
chevallier
800116
800116
What is the user thatlogger
logs?
â Kusalananda
Aug 3 at 16:22
It's my default system user I use to login to X11 or SSH on servers.
â chevallier
Aug 3 at 16:26
add a comment |Â
What is the user thatlogger
logs?
â Kusalananda
Aug 3 at 16:22
It's my default system user I use to login to X11 or SSH on servers.
â chevallier
Aug 3 at 16:26
What is the user that
logger
logs?â Kusalananda
Aug 3 at 16:22
What is the user that
logger
logs?â Kusalananda
Aug 3 at 16:22
It's my default system user I use to login to X11 or SSH on servers.
â chevallier
Aug 3 at 16:26
It's my default system user I use to login to X11 or SSH on servers.
â chevallier
Aug 3 at 16:26
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Because logger
uses getlogin(3)
.
https://github.com/karelzak/util-linux/blob/master/misc-utils/logger.c#L379
static char const *xgetlogin(void)
char const *cp;
struct passwd *pw;
if (!(cp = getlogin())
Which returns "name of the user logged in on the controlling terminal of the process". i.e. your system user.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Because logger
uses getlogin(3)
.
https://github.com/karelzak/util-linux/blob/master/misc-utils/logger.c#L379
static char const *xgetlogin(void)
char const *cp;
struct passwd *pw;
if (!(cp = getlogin())
Which returns "name of the user logged in on the controlling terminal of the process". i.e. your system user.
add a comment |Â
up vote
1
down vote
accepted
Because logger
uses getlogin(3)
.
https://github.com/karelzak/util-linux/blob/master/misc-utils/logger.c#L379
static char const *xgetlogin(void)
char const *cp;
struct passwd *pw;
if (!(cp = getlogin())
Which returns "name of the user logged in on the controlling terminal of the process". i.e. your system user.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Because logger
uses getlogin(3)
.
https://github.com/karelzak/util-linux/blob/master/misc-utils/logger.c#L379
static char const *xgetlogin(void)
char const *cp;
struct passwd *pw;
if (!(cp = getlogin())
Which returns "name of the user logged in on the controlling terminal of the process". i.e. your system user.
Because logger
uses getlogin(3)
.
https://github.com/karelzak/util-linux/blob/master/misc-utils/logger.c#L379
static char const *xgetlogin(void)
char const *cp;
struct passwd *pw;
if (!(cp = getlogin())
Which returns "name of the user logged in on the controlling terminal of the process". i.e. your system user.
answered Aug 3 at 16:30
steve
11.9k22047
11.9k22047
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460368%2fwhy-is-logger-always-executed-as-the-same-user%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What is the user that
logger
logs?â Kusalananda
Aug 3 at 16:22
It's my default system user I use to login to X11 or SSH on servers.
â chevallier
Aug 3 at 16:26