login without using .profile
Have a very simple problem, which maybe someone has already encountered and resolved.
Is there anyway you can login to a box, with a user id, without executing its .profile file. |
No. You can, however, modify .profile to ask the user whether he wants to do the stuff therein. With some C programming skills, you can even get .profile to even time out, so that if the user doesn't respond in, say, five seconds, the stuff gets executed anyway.
Hope this helps. |
This sounds promising.
Can you further elaborate on this. I am fairly good in C and shell, so I may be able to do what is needed. But I need to know what I need to do :-) |
This seems to be divided into two parts.
The first part is to modify file .profile so that it asks the user whether he wants to execute its content. The second part is to modify that so it times out after so many seconds, and just goes ahead and does the script. Since you're familiar with bash scripts, use the if and read statements to get what you need. If you need to get even more familiar, google for this: Code:
bash script tutorial When you have that working, if you wish to push along to the part where response timeout is involved, you'll probably have to do something more advanced. I'd recommend C for that, especially since you're already familiar with it. I'd be happy to help you with that once you have the basic stuff done in the script. Hope this helps. Have fun! |
1. why would you not want to run the .profile??
2. .profile is for the ksh shell; do you mean .bash_profile (bash shell)? |
try logging on a sombody elce, (their profile gets used) the su to whatever user you want
i regually do this to remotly log on to some old unix boxes at work with telnet so that the .cshrec does not get run as for the main user it tries to start a system, which you ahve to be at a graphical login to use, and so gives you and error and tehn logs you out |
As to the name of the file in question, I quote from the O'Reilly bash book by Cameron Newham and Bill Rosenblatt:
Quote:
|
I see wjevans_7d1@yahoo.co's point, about putting the whole of .profile in an if condition. But I think I did not make the problem clear. What if my .profile contains 'exit' in it. I get thrown out as soon as I login!!!!
Getting root to modify my .profile is an option, is there something else? A little clarification I am working in ksh and not bash, so .profile is what I want. |
If that really is your situation, that you're running ksh and your .profile is executing an exit so you can't get all the way logged in, I can think of only one way to avoid going to a root guy to fix this. If you're working in a company whose system administrator is kinda testy, you might want to do just this:
Go to a friend who has a different account. Explain the situation. Ask him to log in to his account, do a Code:
su fred Code:
cd home_directory_of_fred You'll need to give him your password, so change it when you're done. Hope this helps. |
All times are GMT -5. The time now is 12:11 PM. |