I've encountered this while debugging one very strange issue in third party library. Decompiled code made this case even more interesting and not so obvious.
How do you think, what is the output for following program?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Our team has encountered a problem with restarting tomcat server on remote Ubuntu machine.
We have a trusted SSH connection between our machines and the remote one, so we don't have to use passwords when accessing remote machine. However, we had to use a password for restarting tomcat server with this command:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As we are using secure passwords, it was quite annoying to copy/paste this password all the time. Here is the solution that we figured out.
Go to remote machine and run following command:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now all members of tomcat6 group should be able to restart the server without entering password.
It's also nice, that you can provide not only the command that does not require password, but also arguments. In our case, it allowed to simplify tomcat restart while still requiring password for shutting down the server.