Home>

I'm a linux beginner. There are two questions.

I set the log file in linux with script, but carefully

Started. Finished. Will be displayed.

nano .bash_profile

sudo script -f -a ../../ etc/hoge/hoge.log
script started, file is ../../etc/hoge/hoge.log
Finished script, file is ../../ etc/hoge/hoge.log

How can I set this message to be hidden?

Second point
I want to put the log file in/etc.
However, to set the script to start when the user starts
You will be asked for your password every time you log in.
How to set permissions without being asked for a password
Can I set the log every time?
Placing a log file under the user hoge does not want the hoge user himself to modify the log.

Or, if you increase the log file authority, can you set it so that you can not download or edit it even if there is a log file in the hoge folder?

[sudo] hoge password:

  • Answer # 1

    Question 1 At the end of the script

    Script>How about adding/dev/null

    Question 2 If you specify terminal rlogin etc., user and passwd can be saved.
    Is it possible to solve it for the time being by running the script at login?
    think.

  • Answer # 2

    Question 1

    $script -q

    Question 2
    Set log file owner to root and set permissions to 600

Trends