Remove hardcodes password for sudoer postscript#6166
Conversation
| esac | ||
| done | ||
|
|
||
| if [ -z "$SUDOER" ] || [ -z $SUDOERPW ] |
There was a problem hiding this comment.
suggest $SUDOER and $SUDOERPW be set to default value if not specified to keep backward compatibility
There was a problem hiding this comment.
I don't like the idea of using command line argument to pass the password. This idea is even worse than hard code the password. I list some of the reasons below.
- User might need to run something like
chdef mid08tor03cn01 -p 'postscripts=sudoer -u xcat2 -p rootpw'to make it works. It is complex. - It use to have a single place to change the default password. Now it is scattered to node attribute across different compute nodes.
- Passing password with command line argument is insecure. The command line argument can be read by
ps ax.
|
@neo954 , any suggestion which method will be better? I think we should support different sudoer so can't define in the site table, or passwd table, or node attributes. can we prompt the command and ask for user input? I think another options is reading user/password from a file. |
|
|
|
This would be a heavy rewrite to make it correct. Probably for xCAT 2.19 (maybe 3.0)? |
The PR is to fix issue #5115
The modification include
##Remove hardcodes username and password for sudoer
-##User needs to pass in arguments for sudoer username and password
The UT result
##The UT output##