Do not allow bypassing users .profile


 
Thread Tools Search this Thread
Operating Systems AIX Do not allow bypassing users .profile
# 15  
Old 03-05-2015
thank you guys. your thoughts are really helpful. @agent.kgb: its a good idea to change the permissions of the users profile. users shell is already ksh. the problem is that they could call bash shell with --noprofile option through putty. their default shell is ksh. anyway "normally" they never enter command line because when they log in they run straight away the application which connects them to database and when they exit database all their connection shells are exiting.
# 16  
Old 03-05-2015
Three things I have learned by painful experience:-
  • Try to close security holes and some users will always try to find a way around it. Best to give no access except what is needed.
  • Try to make an application easy to use and someone will be unable. There are no limits to stupidity.
  • Give users the ability to do something dangerous by mistake and eventually one of them will.
    So, yes we had a function to delete old data and eventually someone ran it from the top level of the database schema.
The list goes on, but these are applicable to your concerns.



Robin
# 17  
Old 03-05-2015
SCO Is vulnerable to this also.
I have two questions.
  • How does ssh know where to find bash?
  • Does changing the permissions on bash to 0750 and changing the group to something like "admin" also solve this problem?

Last edited by rbatte1; 03-05-2015 at 12:58 PM.. Reason: Added LIST tags
# 18  
Old 03-05-2015
Quote:
Originally Posted by agent.kgb
just put them at the end and restart sshd. if your users should run only one application, use "normal" shell ksh for users, which doesn't have such options, and way better - use rksh (restricted version of ksh), set the PATH correctly in profile, make their .profile files owned by root and only readable by users.
Won't work.

The user owns the directory and can just delete or rename the root-owned .profile and then create their own.

I worked one place that tried that to prevent the use of a ".rhost" file. They created root-owned .rhost directories in everyone's home directory and IIRC set the setgid bit, making it impossible to delete.

Solution?
Code:
mv .rhost .rhost.I_CAN_NAME_ANYTHING_IN_THIS_DIRECTORY_ANYTHING_I_WANT

Then I created an .rhost file just to prove my point.

If the user owns their home directory, they own everything in it and under it.
# 19  
Old 03-06-2015
rbatte1 you are totally right! I experience the same thing a lot of times. It actually makes me angry the fact that the simpler that you are trying to make something to other people the mistakes that are done are more and more "childish". @jgt: im not 100% sure about this but i think is the same way that it find all the other shells (ksh, rksh,etc). through the environment library. if you check the location /usr/bin probably you will find all shells that you can use.
# 20  
Old 03-06-2015
I did a little experiment and set up a user with a restricted ksh shell. I found that using the "bash --noprofile" option did not allow the user to log in; the remote session hangs after accepting the password.
Sftp also failed.
For users that are only allowed sftp access, I use MySecureShell; it does not allow login attempts either.
# 21  
Old 03-06-2015
There is also an immutable file flag on some systems. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Create a new user from using existing users profile

Hello, Just wanting to know if it is possible. Also I am new to command line. I am running 5.1b, if that matters. Thanks in advance (10 Replies)
Discussion started by: bcha
10 Replies

2. Solaris

Remove a given profile from a users account

Hi Guys, I was studying RBAC and I gave a profile to a user . I have not seen anywhere that shows how to remove the profile from the users account. Can anyone show me how to remove a given profile from a users account? Thanks alot guys. (2 Replies)
Discussion started by: cjashu
2 Replies

3. IP Networking

Bypassing My Company Firewall!

Hi! My organization has put a Firewall which eat up a lot of important data access. So I came to know about SSH Tunneling to bypass the Firewall. I will have to setup a free access SSH server to tunnel data access through PUTTY or OpenSSH. The problem is that I don't know about any free... (1 Reply)
Discussion started by: nixhead
1 Replies

4. Shell Programming and Scripting

Users who desire to have their .profile executed must explicitly do so in the crontab entry. Why?

The .profile file should be read when the user logs in. So, there should be no need to execute .profile file again in a cron job (since the cron job is run after the user logs in). Doesn't the cron require login from the user. Then, from where does the cron execute? Please help!! (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

5. UNIX for Advanced & Expert Users

Bypassing blocking of websites...

So my workplace uses websense to block certain websites. I read while researching firesheep, that you can somehow bypass that by creating a proxy, and thus: #1 protect yourself from people using firesheep (if using unsecure hot-spot) and #2 or visit un-approved websites at work. I... (1 Reply)
Discussion started by: zixzix01
1 Replies

6. Shell Programming and Scripting

sourcing .profile for other users

Hi Team, Thank you for your time. i have a situation where the user IDs of the applicatio users have been locked down to Read only. Hence I am writing a script to invoke their old .profile every time they login. My problem is : when i run . $userpath/.profile from within the ksh script... (9 Replies)
Discussion started by: anitha111
9 Replies

7. AIX

SSH and a users .profile

How do I get a command like "ssh Theuser@host date" to execute the /home/Theuser/.profile before executing the "date" command? (5 Replies)
Discussion started by: IL-Malti
5 Replies

8. UNIX for Advanced & Expert Users

How can I get sudo -u <username> to load that users profile on HP-UX

I am running a serverapplication on a HP-UX machine where I need to handle some of the commands as a specified user called "druser". When I log on as this user with the command; sudo -u druser -sit starts an instance of the shell as that user. However, it doesn't load that users .profile from... (1 Reply)
Discussion started by: ukiome
1 Replies

9. AIX

"ksh -" as login shell bypassing .profile

Hi all, I am currently trying to tell /bin/ksh to behave like a login shell. I am invoking it from an interactive shell. In the documentation is stated, that calling it with exec ksh - it should behave like a login shell, work 1st on /etc/profile, ~/.profile and so on. I tried that with... (0 Replies)
Discussion started by: zaxxon
0 Replies

10. Shell Programming and Scripting

users with same .profile

guys i have a unix user (say "x") which is also an application owner ..thru this user i manage most (90 %) of my tasks related to application i.e application down/up,processes stop/start etc..in short i manage my "tuxedo" via this user.. now i want a new user to be created (on my name) which... (7 Replies)
Discussion started by: abhijeetkul
7 Replies
Login or Register to Ask a Question