LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2006, 02:06 PM   #1
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Rep: Reputation: 16
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.
 
Old 03-10-2006, 02:36 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
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.
 
Old 03-10-2006, 02:55 PM   #3
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
I'm using CentOS and to log in I'm using Putty. What do you think might be happening here?

Thanks.
 
Old 03-10-2006, 03:10 PM   #4
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
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.
 
Old 03-10-2006, 03:24 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
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.
 
Old 03-10-2006, 03:51 PM   #6
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
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.)
 
Old 03-10-2006, 04:00 PM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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?
 
Old 03-10-2006, 05:03 PM   #8
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
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?....
 
Old 03-10-2006, 06:30 PM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Still confused :/. If you run "whoami", it should tell you the user account you're logged into.
 
Old 03-11-2006, 07:15 PM   #10
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
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.
 
Old 03-12-2006, 12:18 AM   #11
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
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.
 
Old 03-14-2006, 09:49 AM   #12
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
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.
 
Old 03-14-2006, 10:17 AM   #13
zaphod_es
Member
 
Registered: Jun 2003
Location: Brazil
Distribution: Ubuntu
Posts: 134

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh login rickylim *BSD 7 04-03-2006 03:55 AM
ssh login only with ip CloudBuilder Linux - Networking 3 07-31-2005 12:20 PM
about ssh login... jsnch Linux - Networking 1 07-06-2005 12:39 AM
ftp login -- ssh no login waffe Linux - General 4 12-27-2003 01:42 AM
SSH Login Again gsibble Linux - Newbie 13 08-11-2003 04:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration