LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH login (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-login-423577/)

veeruk101 03-10-2006 01:06 PM

SSH login
 
I've heard that an SSH login is supposed to be the same as a Linux account login. However, I have one SSH login and one root account on Linux, both of which are different usernames. When I log in through my SSH account, it sometimes automatically logs me in to the root account (from where I left off in the previous SSH session), or if I logged out of my Linux account in my previous SSH session, it'll ask me for a Linux account and password.

Is this expected behavior?

If so, still, how does Linux know which SSH account is associated with a particular Linux login (because it placed me back into my root account after logging in through another SSH account)?

Thanks.

pljvaldez 03-10-2006 01:36 PM

What OS and program are you using to ssh in? You may have saved some options in your ssh client that is doing this. I don't know of anything in the ssh config file that would cause this.

veeruk101 03-10-2006 01:55 PM

I'm using CentOS and to log in I'm using Putty. What do you think might be happening here?

Thanks.

veeruk101 03-10-2006 02:10 PM

Because I'm new to Linux, perhaps you could explain what is supposed to happen when you log into SSH. Does each user have one SSH/Linux account, or does each user have a Linux AND an SSH account? Or does everybody share a single SSH account, then once you're logged into the machine, then you log into your own Linux account?

What's supposed to happen when you log in successfully to SSH? Are you immediately in your home directory? Or do you have to enter your Linux account name and password then be authenticated?

I know how to check all the user accounts on a Linux system, but how do I check all the SSH accounts on my system?

The reason I ask all these questions is that in my other post titled 'WinSCP questions', logging in through SCP is freezing up on me. I suspect it's because there's a lot more wrong here than I think. How is WinSCP supposed to know (once I enter the SSH account name and password), that it must login under my root Linux account credentials as opposed to any other?

So confusing, but the more I know about the correct behavior and intricacies of logging in, the better I can articulate my problem and hopefully ask a clearer question on this issue.

Thanks so much.

gilead 03-10-2006 02:24 PM

When you create an account for yourself under Linux, that is what you login with - whether it is locally at a login/screen or console or remotely via SSH. SSH just provides a secure method of getting remote access to a shell on your Linux PC. SSH does not require its own username/password.

Does your root account have a password - the auto login to the root account is something I haven't seen before.

veeruk101 03-10-2006 02:51 PM

Yes, I have a root account with a username of root and a password. In addition, my host gave me an SSH login, that seems to get me into the system itself, from where I have to login further into a Linux account.

I have a Virtual Private Server (VPS), with a shared IP address. Does this have any effect on this situation? Because if it's a shared IP address, then just providing the Linux login and password shouldn't work, am I correct? Because then how would it know which of the many shared servers that Linux login and password is applicable to?

(Btw, the host is unmanaged so I can't ask these questions to them.)

Nylex 03-10-2006 03:00 PM

Quote:

Originally Posted by veeruk101
In addition, my host gave me an SSH login, that seems to get me into the system itself, from where I have to login further into a Linux account.

I'm a bit confused as to what you mean. Surely when you use SSH, you're logging into a user account on that Linux machine?

veeruk101 03-10-2006 04:03 PM

I tried checking this by looking in the /home directory for a subdirectory with the name of the SSH login they gave me, but the /home directory is empty. Doesn't this mean that no matter what SSH account I'm using, it can only log into root, because no other Linux account has been created?

Or is there any way for a SSH login to be mapped to another account like root?

I'm really confused now, and I think I've confused everyone else too...crazy, huh?....

Nylex 03-10-2006 05:30 PM

Still confused :/. If you run "whoami", it should tell you the user account you're logged into.

veeruk101 03-11-2006 06:15 PM

I'll try to clarify: Using Putty, I enter 'myMachineName' and 'myMachinePassword' (which were automatically assigned to me by my VPS host), and connect to my *shared* IP address for my Virtual Private Server. After this, one of 2 things happens:

1) I am directly logged into the Linux account on my machine with username 'root', and continue from exactly where I left off the last time I was logged in.

OR

2) If I logged off my 'root' account the last time I was logged into SSH, then it asks me for "myMachineName login:", and I enter the username and password with which I would like to log on to the system. So I enter 'root' and 'myRootPassword', and am logged in.

Perhaps this might clarify what's actually happening. What else should I check or clarify that could help you help me diagnose this issue?

Thanks.

prasanta 03-11-2006 11:18 PM

Do you want to say that if you don't log off from your root account the last time you logged in, you can still use the root account the next time you log in ?
In the first case didn't you specify the username. In putty you have the option of saving the username. I think somewhere in your putty you have saved the user as root.

veeruk101 03-14-2006 08:49 AM

Regarding many people's comments that SSH should be allowed into any account on the Linux machine, here's what my host said...does this mean it's not possible for me, or is there just some miscommunication?

So, to answer your question about a user created on a server that is of any UNIX
flavor opearting system would be allowed or able to ssh to a server if the
account is allowed. This is done by providing the account with a shell whch
allows ssh. If you have cpanel then you would log into WHM and use the SSH
amanger to enable SSH. This of course is if you have a reseller account with us
or a vps with your own install of cpanel.

zaphod_es 03-14-2006 09:17 AM

I am not quite sure that I understand exactly what is happening here but I do have a few comments.

A *nix installation has users. Provided that they are allowed SSH privileges Linux does not care whether they logged in at the keyboard or via SSH.

It sounds a quite unbelievable security hole that allows you to log in under your ordinary user name and then get given root. If this is a commercial web hosting server I do not believe it. In fact it is bad policy to allow root to log on remotely at all. It is far better to log in as an ordinary user and use su or sudo.

I think that your host is saying that, depending on what service the customer signs up for, you can have SSH access if you tick the option in your Control Panel (presumably html based). Assuming that you have done this you should have the access.

It sounds as though you do have SSH access and Putty should allow you to log in using username@hostname.com and then providing your password at the prompt. If you have saved the login as root delete it and replace it with the ordinary username. My best guess is that this "root" login is the one that allows you full control over your account and nothing more. It is useful when you want to allow people to change web pages but not access the hosting and admin options

Does this help? If not try to give a little more information

ZB


All times are GMT -5. The time now is 08:43 PM.