Parallels H-Sphere Forum
> Parallels H-Sphere > Troubleshooting  
ssh jail login problems  
  

ssh jail login problems

07-12-08, 00:16
#1  

blizzard-media.
Registered User


Join: Jan 2005
Posts: 17
ssh jail login problems
Since I have upgraded to 3.1 I have a problem logging in now that the jail is setup:

Code:
rickyn@zooloo:~/$ ssh account@example.com
account@example.com's password: 
Last login: Sat Jul 12 00:09:07 2008 from myisp.net
Mounting all needed directories....      DONE
jail: can't canonize path "/bin/sh". Bad path?
Connection to example.com closed.
Any ideas?
07-12-08, 04:28
#2  

vibe
Registered User


Join: Jul 2002
Posts: 245
From the docs at http://www.psoft.net/HSdocumentation...here-jail.html

Try this:

/hsphere/local/config/jail/scripts/check_jail

checks whether utilities and their libraries, which are included in the jail enviroment, were changed (for example after system update). If so, the /hsphere/local/config/jail/scripts/config_jail is executed.

Maybe this will find problems with the jail environment.

__________________
-- Pablo
07-12-08, 06:34
#3  

vibe
Registered User


Join: Jul 2002
Posts: 245
I think the reason you are getting this error is because the user did not fully logout previously.

Check the ps -aux output for any processes running the bash shell for the user you are trying to login as. If they exist, kill them, then try again.

This just happened to me and that's how I solved it.

Thanks.

__________________
-- Pablo
07-12-08, 10:00
#4  

blizzard-media.
Registered User


Join: Jan 2005
Posts: 17
Quote:
Originally Posted by vibe View Post
Try this:

/hsphere/local/config/jail/scripts/check_jail

checks whether utilities and their libraries, which are included in the jail enviroment, were changed (for example after system update). If so, the /hsphere/local/config/jail/scripts/config_jail is executed.

Maybe this will find problems with the jail environment.
I had already tried that, but just for fun I tried it again:

Code:
[root@host ~]# /hsphere/local/config/jail/scripts/check_jail 
 + checking md5 sums...
 + all md5 sums are correct. Reconfiguration is not needed.
And when I try to login, I still get the same error as you might expect
07-12-08, 10:03
#5  

blizzard-media.
Registered User


Join: Jan 2005
Posts: 17
Quote:
Originally Posted by vibe View Post
I think the reason you are getting this error is because the user did not fully logout previously.

Check the ps -aux output for any processes running the bash shell for the user you are trying to login as. If they exist, kill them, then try again.

This just happened to me and that's how I solved it.

Thanks.
That was a good idea, unfortunatley I don't have any processes running as my user

Code:
[root@host ~]# ps aux | grep wwwuser
root     13334  0.0  0.0  3968  628 pts/0    R+   10:02   0:00 grep wwwuser
Any other ideas would be greatly appreciated...
07-12-08, 10:05
#6  

vibe
Registered User


Join: Jul 2002
Posts: 245
Try to recreate the jail completely. This is done by executing:

/hsphere/local/config/jail/scripts/config_jail

Let it run, it will recreate everything in the jail. They you can try again. I hope this helps.

__________________
-- Pablo
07-12-08, 10:35
#7  

vibe
Registered User


Join: Jul 2002
Posts: 245
Hi there, I found another way to try and fix this.

Edit the /etc/passwd file by hand of your root install (not in the jail) and change the wwwuser's shell to /bin/bash.

Then login as wwwuser via SSH. This will remove all the jail sym links,etc from the wwwuser home directory. Logout.

Then edit the /etc/passwd file again and set the shell to /hsphere/shared/bin/jail.

Then login as wwwuser. This will recreate the sym links in the wwwuser home directory. See if that 'resets' that user.

Cheers.

__________________
-- Pablo
07-13-08, 15:33
#8  

blizzard-media.
Registered User


Join: Jan 2005
Posts: 17
Quote:
Originally Posted by vibe View Post
Try to recreate the jail completely. This is done by executing:

/hsphere/local/config/jail/scripts/config_jail

Let it run, it will recreate everything in the jail. They you can try again. I hope this helps.
I tried that too:

Code:
[root@host ~]# /hsphere/local/config/jail/scripts/config_jail
 + cron task added.
 + creating chroot environment.
 + created chroot environment in /hsphere/local/jail.
 + installing basic set of programs...
 + basic set of programs installed in /hsphere/local/jail.
 + installing additional set of programs and data ...
 + additional set of programs installed in /hsphere/local/jail.
 + formed md5 sums snapshot of jail executables and shared libraries.
When I try to login I get the same error:

Code:
rickyn@zooloo:~/$ ssh user@host
user@host's password: 
Last login: Sat Jul 12 00:12:14 2008 from myISP
Mounting all needed directories....      DONE
jail: can't canonize path "/bin/sh". Bad path?
Connection to host closed.
Not having much luck...
07-13-08, 15:50
#9  

blizzard-media.
Registered User


Join: Jan 2005
Posts: 17
Quote:
Originally Posted by vibe View Post
Hi there, I found another way to try and fix this.

Edit the /etc/passwd file by hand of your root install (not in the jail) and change the wwwuser's shell to /bin/bash.

Then login as wwwuser via SSH. This will remove all the jail sym links,etc from the wwwuser home directory. Logout.

Then edit the /etc/passwd file again and set the shell to /hsphere/shared/bin/jail.

Then login as wwwuser. This will recreate the sym links in the wwwuser home directory. See if that 'resets' that user.

Cheers.
OK, I'm not sure I'm following you on this one. Here is what I did:

1) as root edit the /etc/passwd and set shell for wwwuser to /bin/bash
2) login as wwwuser. I get the following message on login:

Code:
Last login: Sun Jul 13 15:40:59 2008 from myISP


          #############################################################################
          #                                                                           #
          #  The following file managers are available:                               #
          #                                                                           #
          #  mc     - GNU Midnight Commander   (http://www.ibiblio.org/mc)            #
          #  vifm   - ViFM a UNIX Filemanager  (http://vifm.sourceforge.net)          #
          #  ytree  - Ytree a UNIX Filemanager (http://www.han.de/~werner/ytree.html) #
          #                                                                           #
          #############################################################################
3) logout
4) as root put the shell for wwwuser back to /hsphere/shared/bin/jail
5) login as wwwuser. I get the the same error:

Code:
rickyn@zooloo:~/$ ssh wwwuser@host
wwwuser@host's password: 
Last login: Sun Jul 13 15:41:26 2008 from myISP
Mounting all needed directories....      DONE
jail: can't canonize path "/bin/sh". Bad path?
Connection to host closed.
You said one thing though that has caught my interest..."This will recreate the sym links in the wwwuser home directory"...I don't have any symlinks in my directory...what should they be?

__________________
Blizzard Media: www.blizzard-media.com
We sell Symfony hosting
07-13-08, 18:57
#10  

blizzard-media.
Registered User


Join: Jan 2005
Posts: 17
Resolved
Your hint about the symlink helped me figure this out. I had my own bin directory that was in the way of letting the bin symlink from being created. Once I moved mine to another location, then it was able to create the proper links and now I can login correctly.

Thank you for all of your help!

__________________
Blizzard Media: www.blizzard-media.com
We sell Symfony hosting
07-14-08, 04:40
#11  

vibe
Registered User


Join: Jul 2002
Posts: 245
Glad you solved it. It is important to point out that you should not have the following directories in a user's home directory:

bin dev etc lib usr

This will cause trouble. The jailmount script should probably be modified to check for their existance, if so, give an appropriate error. Parallels?!

__________________
-- Pablo


Thread tools Rating Display modes
Excellent
Good
Average
Bad
Terrible
Linear Mode


Parallels is a worldwide leader in virtualization and automation software that optimizes computing for consumers, businesses, and service providers across all major hardware, operating system, and virtualization platforms. Founded in 1999, Parallels is a fast-growing company with 900 employees in North America, Europe, and Asia.