Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between telnet and su command

Status
Not open for further replies.

maleal

Technical User
Dec 20, 2002
9
0
0
US
Hello,

I've a machine with solaris 5.8 and I've created a new user in that machine (for example "user1").
- When I do a telnet to that machine and login as "user1", I've all environment settings working correctly.
- When I do a telnet to that machine and login as root and then do a "su - user1", the environment settings are not the same as when I login directly as user1.

Login directly as user1 or through su command should not be same thing? Could anyone help on this?

Cheers,
Miguel
 
Which shell is user1 logging into? My understanding is that su doesn't understand some of the less common shell startup files.
 
Both user1 and root use the same shell - Korn shell.
 
Does user1 have their own .kshrc file in their home directory?
 
Question 1 - If I login directly to the machine as user1 I'm allowed to do a certain kind of commands, only allowed to this user. If I do it through "su - user1" I'm not allowed to.

The only diferences I found is in the "env" command output. Doing a login through "su -" I was expecting to have at least the same environment variables has logging directly as user1. I do not know why the env output, through su has less environment variables as the direct login...

Question 2 - No, this user does not have .kshrc file. We only have a .profile.
 
Ok when you say certain kinds of commands are you refering to RBAC, SUDO, path settings? Yes that would be true about su having less environment variables.
 
No, we are just running some scripts with no special privileges.
 
Does it give you a error message you when you try running it?
 
We do not obtain an error. We are using some scripts to update some data using user1. And we are not able to updated it using su command.

It's a little bit difficult to explain what is happening because it's very related with the application we are running.

I think the problem should be in the diferences between the environment variables when logging directly and through su. There is no idea why the env variables are different?
 
I don't know whether /etc/profile is read when you su. Perhaps that's the difference?
 
Small correction my friends when you do su it will read both .profile as well as /etc/profile
 
Hi Miguel,

You mentioned in an early post that "The only diferences I found is in the "env" command output. Doing a login through "su -" I was expecting to have at least the same environment variables has logging directly as user1. I do not know why the env output, through su has less environment variables as the direct login...". Perhaps you could say what some of those differences were. That might help in diagnosing the problem. Also, as well as the env command, you could try the set command to list the environmental variables and compare the differences from telnet & login with su - user1.

I hope that helps.

Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top