2 Answers
- Newest
- Most votes
- Most comments
0
Which locations did you check - it can be set in any (or all) of /etc/bashrc, /etc/login.defs, /etc/profile, and files under /etc/profile.d/
It can also be in the user's ~/.bashrc or ~/.bash_profile
0
Hello.
Did you edit the umask value in the file below?
In my environment, the umask of the newly created user was changed by editing the following file.
sudo vi /etc/bashrc
After updating the file, you need to update it using the following command.
sudo source /etc/bashrc
Relevant content
- asked 2 years ago
- Accepted Answerasked 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a month ago
I changed the umask from 022 to 077 in the following files. But the default umask remains 022 for every login: /etc/login.defs /etc/cs /etc/csh.cshrc /etc/bashrc /etc/profile /etc/profile.d/set-umask-for-all-users.sh /etc/rc.d/init.d/functions There are no umask entries n any of the files in the user's home directory.
Run
bash -x
to spawn a new shell with debug mode enabled, and don't be surprised if the output is hundreds of lines long. Somewhere in all this is the time(s) that the umask value is checked, and potentially changed.It may be easier to go through this output as a file:
Now you can go through /var/tmp/bash-x.out looking for any instance of umask or UMASK
Seeing the output from bash -x is interesting but only thickened the plot. I can see the last time the umask is set, is in fact 077. And inside that shell it really is set to 077. Yet when connecting through the session manager it is 022. See snip below:
Now it's clear - Session Manager doesn't run bash https://repost.aws/knowledge-center/ssm-session-manager-change-shell
All the files that we're looking at at for setting the environment for a user who uses bash.
The steps to change Session Manager's login shell to bash are in that linked knowledge document, or you could just run bash from the command line to launch a new bash shell, or you could
sudo su - ec2-user
to become another user whose login shell is the bash shell.