Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit is required before calling whoami in lab5 #3

Open
behzadnj opened this issue Feb 26, 2020 · 0 comments
Open

Exit is required before calling whoami in lab5 #3

behzadnj opened this issue Feb 26, 2020 · 0 comments

Comments

@behzadnj
Copy link

behzadnj commented Feb 26, 2020

When you run "sudo su - [email protected]", the user gets switched to vsda. Documentation states that the "root" account should be shown after running "whoami" command. Additionally "rm /etc/sudoers.d/minions" will fail since we are still using vsda account.

"""
[root@ip-172-31-19-115 ~]# sudo su - [email protected]
Creating home directory for [email protected].
[[email protected]@ip-172-31-19-115 ~]$ rm /etc/sudoers.d/minions
rm: cannot remove '/etc/sudoers.d/minions': Permission denied
"""

This can be solved by adding "exit" before removing minions:

[root@ip-172-31-19-115 ~]# sudo su - [email protected]
Last login: Wed Feb 26 09:46:52 UTC 2020 on pts/0
[[email protected]@ip-172-31-19-115 ~]$ rm /etc/sudoers.d/minions
rm: cannot remove '/etc/sudoers.d/minions': Permission denied
[[email protected]@ip-172-31-19-115 ~]$ exit
logout
[root@ip-172-31-19-115 ~]# rm /etc/sudoers.d/minions
rm: remove regular file '/etc/sudoers.d/minions'? y
[root@ip-172-31-19-115 ~]# whoami
root
[root@ip-172-31-19-115 ~]#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant