Killing startup programs

General support questions
Post Reply
croiwen
Posts: 2
Joined: 2015/04/28 12:16:19

Killing startup programs

Post by croiwen » 2015/04/28 12:26:07

I made a beautiful mess:

I created a foo.sh script in /etc/profile.d/ . foo.sh does terminate when logging in as a non-root user. However, it fails when logging in as root via "su" and it does not
terminate. Thus, after typing

Code: Select all

$ su
Password: 
(and entering the password) it fails to terminate and does not do anything anymore. This causes the problem, that I cannot delete foo.sh since I cannot log in as root anymore and my user is not in the sudoers file... Any chance of getting rid of foo.sh? For that matter, it would be only necessary to delete one line in foo.sh - but I cannot do that not being root -.-

Any help is appreciated.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Killing startup programs

Post by TrevorH » 2015/04/28 15:52:28

Can you run su - ? Do you have any other shells installed like csh/tcsh/ksh that you can use the -s su parameter for? If not then you can boot in rescue mode from the install media and delete the file from there.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply