Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Now the machine asks for password...The ssh was configured with key auth.. The problem is that ksh doesn't has executable permission anymore.. :\ What can I do remotely? Any tips?

The root's shell was ksh.. :\

p.s.: there aren't any users that use a non-ksh shell+remote login enabled.

share|improve this question
    
1  
@ LanceBaynes that executes above the default shell. –  Steve-o Aug 29 '11 at 5:13
    
ok........... :) –  LanceBaynes Aug 29 '11 at 6:28
    
I don't understand...now the ksh is 644 and you cannot login because the shell is not executable? Can you give more details? –  lamwaiman1988 Aug 29 '11 at 7:07
    
yep, probably that is the problem. it asks for password, and my colleauge said that he accidentally chmod'ed the "/usr/bin/ksh" before :) –  LanceBaynes Aug 29 '11 at 16:19

6 Answers 6

up vote 5 down vote accepted

Unfortunately AIX su doesn't have the --shell parameter available on other platforms. Do you have any user defined on the system without Korn shell?

Use the serial console and boot into maintenance mode, hopefully it's shell comes up.

Unless prepared before hand network booting likely to be too troublesome.

Otherwise you need someone with physical access and an AIX disk.

share|improve this answer
    
yep, maintenance mode was the solution... –  LanceBaynes Sep 26 '11 at 23:05

Can you scp over the passwd file to your local box and then replace which shell is your default and scp the file back? Just trying to be helpful.

share|improve this answer
    
good idea, we will try it out if it works. :) thanks –  LanceBaynes Aug 29 '11 at 6:29
    
bad news: it asks for password too, just like when trying via ssh.. :\ –  LanceBaynes Aug 29 '11 at 6:52

Can you use the KSH's owner id to login via FTP client FileZilla? It have options to chmod the files in the FTP client.

share|improve this answer
    
ftp, sftp, rcp, scp but you have to have non-locked down permissions and hope the shell is not checked. I think ftp only checks the shell name at worst, but scp I think spawns a shell. –  Steve-o Aug 29 '11 at 8:28
    
sftp => no luck –  LanceBaynes Aug 29 '11 at 21:36
    
normal ftp => no luck –  LanceBaynes Aug 29 '11 at 21:36
    
scp => no luck.. –  LanceBaynes Aug 29 '11 at 21:36

I'm pretty sure you'll need physical access to the machine to fix it.

First, try booting to single user mode. That may fail trying to run ksh though. On PC's you can pass boot parameters to the kernel through [lilo|grub] or through OpenFirmware on SPARC. If there's any type of equivalent on AIX try passing init=/bin/sh as a boot argument.

That should get you at least a shell, but that's all. Your root fs may be mounted read-only, so remount it rw. You should then be able to fix the permissions. Afterward make sure you sync. The kernel will probably panic if you try to exit or reboot, so just expect that. When you're done reset the machine.

Good luck, and may the Force be with you.

share|improve this answer

Problem solved with downtime...

We were thinking about to "sed" the "image file" of the LPAR on the vio (ksh to csh :D ). - but it was better to do boot in single mode, etc in a downtime..

thank you all!

share|improve this answer

Can you use ssh with command as argument? Like:

ssh user@hostname /bin/sh
share|improve this answer
    
"that executes above the default shell. – Steve-o" –  LanceBaynes Aug 30 '11 at 13:47
    
yes, but it asked for passwd –  LanceBaynes Aug 30 '11 at 13:48
    
@LanceBaynes and does no one have a password? –  Kevin Dec 13 '11 at 19:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.