0
I have remote location Linux running (CentOS 6.0). It has dynamic ip address so i installed noip2 service and copied the file cp redhat.noip2.sh /etc/profile.d/noip.sh.
Here you can see the noip.sh script running now for ever on reboot (see).
After that when the system restarted once, it never have the correct shell. As a result remotely when i try to ssh the server i cant login and i cant do anything. Can anyone solve this? Here is the details i tried:
When i debug the ssh i see that debug1: Authentication succeeded (password).
and command is also sent but nothing just happen. I simply cant fix it yet.
All failed:
ssh root@host 'rm -fr /etc/profile.d/noip.sh'
scp emptynoip.sh root@host:/etc/profile.d/noip.sh
ssh root@host /bin/sh
ssh root@host /bin/bash
ssh root@host --norc -i
ssh root@host -- --norc -i
ssh root@host bash --norc -i
ssh root@host /bin/bash -i './etc/profile.d/noip2 stop'
ssh root@host /bin/bash -i './etc/profile.d/noip stop'
ssh root@host /bin/bash -l './etc/profile.d/noip stop'
many more... combination i tried all failed. Is there any single option that i can try?
What happens when you tried these exactly? Did you get an error message? If so, what error? – David Schwartz – 2011-08-29T15:56:17.590
For future reference: calling noip services from
/etc/profile.d
is a bad idea. (Situation: server reboots, obtains a different address, but DNS is not updated since profile.d is launched at login time, and you cannot login without updating DNS first...) Use/etc/rc.local
or similar instead. – user1686 – 2011-08-29T16:16:40.050What happens when you try pressing Ctrl-C after the "sent command" message is displayed? In most shells,
profile
files can be interrupted that way. Ctrl-Z and Ctrl-\ may work too. – user1686 – 2011-08-29T16:17:42.937I tried to put on-site someone to physically remove the /etc/profile.d/noip.sh and apply init 6. But on-site with keyboard they cant login either using username root and password. Always they get login prompt now. Ctrl-c i cant apply its very small duration we have in that period. – YumYumYum – 2011-08-29T16:21:41.900
Can i send remotely ssh root@host 'ctrl-c or ctrl-z' ? – YumYumYum – 2011-08-29T16:22:07.030
Here is the details: https://gist.github.com/1178759
– YumYumYum – 2011-08-29T16:24:42.020I don't really understand your question.. But just to be sure, the command-line application "screen" won't resolve this for you?? – James T Snell – 2011-08-29T16:42:22.627
@Doc, if you put the above script in your /etc/profile.d/noip.sh and then do #ssh localhost and try to login you will see you cant login anymore. That is my problem. – YumYumYum – 2011-08-29T16:58:10.857
@89899.3K No, you cannot, because those are not commands. Those are keys you have to press after running
ssh root@host
and logging in. – user1686 – 2011-08-29T18:37:26.937@grawity: I installed a virtualbox. With Debian and there i copy and paste the noip.sh script into /etc/profile.d/noip.sh and then if i do ssh localhost it shows noip.sh but if i apply ssh localhost 'init 6' it reboots. But i cant do that in CentOS? – YumYumYum – 2011-08-29T19:34:58.320
Thanks it was solved finally, i placed the correct steps for future reference. – YumYumYum – 2011-09-03T22:19:22.600