- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Revert chsh changes
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 04:59 AM
тАО01-17-2011 04:59 AM
I have accidently changed the shell using chsh of user prdadm. Now the environment variables are gone and nothing is working via the user.
Please advise on how to revert these changes. I have a Data Protector backup. Which files should I restore in order to gain the functionality back?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:10 AM
тАО01-17-2011 05:10 AM
Re: Revert chsh changes
chsh prdadm /usr/bin/sh
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:12 AM
тАО01-17-2011 05:12 AM
Re: Revert chsh changes
Already tried "chmod prdadm /usr/bin/sh", but it's not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:17 AM
тАО01-17-2011 05:17 AM
Re: Revert chsh changes
Also, I am failing to run sqlplus, due to which other problems are arising.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:40 AM
тАО01-17-2011 05:40 AM
Re: Revert chsh changes
> Already tried "chmod prdadm /usr/bin/sh", but it's not working.
Re-read Bill's post. You need to use 'chsh' not 'chmod'.
Another way is, as root, edit the 'prdadm' account in '/etc/passwd' and specify '/usr/bin/sh' as the login shell.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:42 AM
тАО01-17-2011 05:42 AM
Re: Revert chsh changes
> Already tried "chmod prdadm /usr/bin/sh",
> but it's not working.
"chsh" and "chmod" are spelled differently
for a reason.
"It's not working" is not a useful problem
description. It does not say what happened
when you tried this (wrong) command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:47 AM
тАО01-17-2011 05:47 AM
Re: Revert chsh changes
Already told you the error I am getting. The user prdadm does not recognise sqlplus command, and in turn SAP startup is failing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 05:58 AM
тАО01-17-2011 05:58 AM
Re: Revert chsh changes
The environment variables are normally set with the user's profile and for sane shells like POSIX and ksh, that would be .profile, possibly .kshrc. To see what the user has right now, use this command:
awk -F: '/prdadm/{print $NF}' /etc/passwd
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 03:16 PM
тАО01-17-2011 03:16 PM
Re: Revert chsh changes
This should be as simple as restoring /etc/passwd (if system isn't trusted).
Of course, have you made any other changes to that file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 03:26 PM
тАО01-17-2011 03:26 PM
Re: Revert chsh changes
And then what happened? Did you get the
user's shell changed back to the right one?
> Already told you the error I am getting.
When you did what, exactly?
As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions or interpretations. And using
copy+paste can be more reliable than trying
to do it manually.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 06:48 PM
тАО01-17-2011 06:48 PM
SolutionThe simplest for you would be to have your system administrator (root user), to change your login shell...
It seems as you have changed the login shell from cshrc perhaps to sh/ksh.
csh reads .cshrc file to set you environment
sh/ksh reads your .profile to do this
Now, when switching shell - you seem to have an error in .profile which terminate the processing of defining your environment correctly, or forking new shells.
The mess relate to the error given when parsing the .profile - so you need to get this corrected - and again... since you seem a bit unfamiliare with unix I suggest you get the root user to do this.
Should I pick a guess - you have a .profile who try to source several other environment files - and have syntax error in one of them.
... could even be a SAP system ;)
An alternativ could be to move away the current .profile and replace with a simple template file, just so that you can run the chsh command
/Tor-Arne
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 10:15 PM
тАО01-17-2011 10:15 PM
Re: Revert chsh changes
Thanks for all your help. Sorry that I was in a rush yesterday that's why I could copy/paste the commands.
Anyways, Tor-Arne's reply was the best and right on the mark, although I am not that much unfamiliar with UNIX. Everyone needs a little help here and there.
Anywho. My original shell was apparently "csh". Which I changed to "ksh" and so it was having trouble processing the .profile file as Tor-Arne put it. I then changed the shell to "sh", think that it was the original shell. But still the .profile was not being processed properly.
Now with Tor-Arne's help, I've restored the original "csh" shell. There are lots of variables being set in the ".cshrc" file.
Now the system behaviour is back to normal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2011 10:18 PM
тАО01-17-2011 10:18 PM
Re: Revert chsh changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 09:57 AM
тАО01-18-2011 09:57 AM
Re: Revert chsh changes
This user had a non-standard shell, csh in this case. That means that all the customization you required was never in .profile (the standard for POSIX and ksh) so all the suggestions would not work until you changed back to /usr/bin/csh as the shell.
So for any user that is runing csh, you should not change the shell until the user translates all the customized .cshrc commands into a .profile, something does require some experience. Otherwise, don't change the shell. This is why most sysadmins reject the use of csh (and relatives like tcsh) for use in Unix servers -- they are incompatible with standard shells.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 12:02 PM
тАО01-18-2011 12:02 PM
Re: Revert chsh changes
> use of csh (and relatives like tcsh) for
> use in Unix servers -- they are
> incompatible with standard shells.
"most"? Really? You took a survey? I've
noticed that Spanish is "incompatible with"
English (the "standard" language), too. Do
these "sysadmins" also "reject the use of"
Spanish (and relatives like Portuguese)? Do
they also reject the use of Fortran and
Pascal because they're incompatible with
standard C?
"Different" and "incompatible" are spelled
differently for a reason.