|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using alias to create subshell and work in it
using kerberos to access remote server. first I execute Code:
kshell to create subshell and then Code:
kinit username@domain in that subshell. After that it prompts to enter password. Since I need to do this over and over, I am trying creating alias. I tried Code:
kshell; kinit username@domain . Did not work, comes back to parent shell and if I type exit, it prompts for password. Will appreciate any suggestions to create a smart alias in bashrc. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
You're trying to create an alias that types in your password for you?
Authentication systems read direct from the terminal, that's not going to work. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
If you just want to launch the kinit command using kshell, omit the semicolon: Code:
alias kk='kshell kinit username@domain' Better yet with full path, like Code:
/bin/kshell kinit username@domain Or you can wrap it in a script: Code:
#!/bin/kshell kinit username@domain make it executable and copy it somewhere in your $PATH/ |
|
#4
|
|||
|
|||
|
I am not trying to enter password through alias, just trying to combine kshell and kinit commands.
Thanks for reply mirni, your proposed solution did not work for me. It gives no error but returns to parent shell and does not ask for password. |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Quote:
The problem is, you are asking for kshell to read from two different things -- want it to run a noninteractive shell to do something in, then suddenly become interactive and accept input from a user. Putting a semicolon afterwards doesn't tell it to feed that command into kshell. It tells it to feed it into your shell. Depending on how kshell works, perhaps something like this: Code:
kshell kinit username@domain ';' exec /bin/sh should execute the command, then run an interactive shell after that... The quotes around the semicolon so that kshell gets fed the whole thing instead of your local shell breaking it into two statements. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
corona and mirni, both of yours' suggestions did not work so far The usual process: Code:
$ kshell $ kinit username@domain Password for username@domain: Code:
$ kshell kinit username@domain $ $ kshell kinit username@domain ';' exec /bin/sh $ writing a script as suggested by mirni also did not work. I am trying to create the alias as I have to do this procedure several times each day. Thanks |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Quote:
Also please tell me more about this 'kshell'. Whether what you want is even possible or not depends on how it works, and I can't seem to find any consistent information on it. Perhaps a script like this: Code:
#!/bin/kshell kinit username@domain exec /bin/sh |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create alias files (not alias commands) | Alexander4444 | UNIX for Dummies Questions & Answers | 3 | 04-16-2012 10:57 AM |
| A very simple script, but alias won't work | sssccc | UNIX for Dummies Questions & Answers | 20 | 05-22-2010 07:49 AM |
| Bash alias for complicated ls command does not work. | gencon | Shell Programming and Scripting | 16 | 03-16-2010 04:26 PM |
| Global alias does not work in shell script | zam | Shell Programming and Scripting | 2 | 08-17-2009 03:04 AM |
| alias doesn't work | miojamo | Shell Programming and Scripting | 2 | 03-06-2009 03:53 AM |
|
|