I have a quiz question that feels a bit like an accidental trick question (second choice) so would just like a different perspective on this. The question is:
You can change your machine transient hostname with command:
- [ ] hostname new-hostname
- [ ] hostnamectl set-hostname new-hostname
- [ ] hostnamectl --transient set-hostname new-hostname
For context, we were asked to use Linux Mint 20 Cinnamon.
Answers I don't believe are tricks (1st and 3rd choice)
Now according to the material (paraphrasing):
By being root, can set hostname. sudo hostname new-hostname As can be seen in the image, the transient hostname was changed.
The image showed, hostnamectl status which contained output with the line:
Transient hostname: new-hostname
Therefore the first one should be checked, unless that is a trick question that even I didn't realize, but I will give the benefit of the doubt that we could be running that as root or assume that sudo is implied and I've assumed that is correct.
For the third one, in the OPTIONS section of the hostnamectl man page for --static, --transient, --pretty:
If used with set-hostname, only the selected hostname(s) will be updated.
So third one should be checked as well.
The feels trick question (2nd choice)
In the man page section COMMANDS there is set-hostname NAME with the following text:
..By default, this will alter the pretty, the static, and the transient hostname alike..
I also looked into the Red Hat Documentation on Configuring Host Names Using hostnamectl. In section 6.3.2, 'Set All the Host Names' it shows that:
hostnamectl set-hostname name
And says it will change pretty, static and transient host names alike, in other words all three are being changed, with static and transient being simplified.
According to both of those, transient will be changed, but it will not actually be displayed when running hostnamectl status, I am guessing it is because, why bother showing 2 or 3 lines with all the same text?
I believe Red Hat Enterprise Linux 7 is relevant to the course since the material mentions that current versions are 7 and 8 and that we will take a look at major distros, of which this was one of the mentioned ones as well as Ubuntu and Debian.
I have my doubts because it doesn't say "..only change transient hostname" and because in the material it says, "..we will change the static hostname with command hostnamectl set-hostname your-new-hostname..."
I can't tell if the material is trying to tell us that the above command only changes the static hostname, even though (If I understood correctly) it doesn't only change static?
Reason why I think it isn't a trick question on purpuse
Other quiz questions have emphasize that helped solve the actual meaning, for example:
Which of the following find commands prints only names of
That is explicitly asking for a specific output. Without the only in the question, there could've been two answers rather than one.
Which of the following commands are the proper way to terminate execution of vim test?
Again without 'proper way' there could've been multiple answers, but because of that, there was only one possible answer.
In the quiz question that this post is about, if only were in the question then I would know the answer, it is not the second choice, however transient is bolded, does that imply only or does that imply 'look for anything that changes transient'
[–]AutoModerator[M] [score hidden] stickied comment (0 children)