PDA

View Full Version : SSH connection fails on users


SamTzu
22nd April 2007, 00:07
Hi, I can't seem to make an SSH connection with any other account except admin.

I get this message...
/bin/bash: No such file or directory
Connection to server closed.

Any ideas?


Sam

Leszek
22nd April 2007, 00:27
Aren't Your users supposed to be chroot-ed ?
Is the value of $go_info["server"]["ssh_chroot"] equal 1 or 0 in /home/admispconfig/ispconfig/lib/config.inc.php ?

SamTzu
22nd April 2007, 01:30
Yes, chroot is in use.

$go_info["server"]["ssh_chroot"] = 1;


Sam

Leszek
22nd April 2007, 01:56
For chroot on SSH to work you need to activate SSH in the ISPConfig settings and patch the SSH server like it was done in this howto (http://www.howtoforge.com/chrooted_ssh_howto_debian).
After that this setting will make sense:
$go_info["server"]["ssh_chroot"] = 1;
and chrooting will work for new users.Others will be "free".
It seems that you maybe missing some files in your user's jail.For example in Debian it would be /var/www/your site's address/user/your user's name/bin. There are the needed files like:bash,ls,mkdir,mv,ping,pwd etc.
I guess that at least the first one isn't there.
Also the admin user isn't chrooted.

SamTzu
22nd April 2007, 12:59
Actually I'm testing the ISPConfig virtual machine from VMWare.
I have been able to over come most problems with it except this.
ISPConfig user does have /bin/bash and I checked that user web24_user1 has correct permissions on that folder.

:confused:
I'm confused. Where can I see how the chroot is configured?


Sam

SamTzu
22nd April 2007, 13:40
When I login as admin and do su web24_user1 I get this with set

server1:/var/www/www.miila.com# su web24_user1
web24_user1@server1:/var/www/www.miila.com$ set
BASH=/bin/bash
BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i386-pc-linux-gnu")
BASH_VERSION='2.05b.0(1)-release'
COLUMNS=207
DIRSTACK=()
EUID=10007
GROUPS=()
HISTFILE=/var/www/web24/.//.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/var/www/web24/./
HOSTNAME=server1.smpets.com
HOSTTYPE=i386
IFS=$' \t\n'
LINES=62
LOGNAME=admin
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33: so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31 ;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:* .taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=0 1;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;3 1:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35 :*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:* .tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.t iff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mp eg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=0 1;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01; 35:*.wav=01;35:'
MACHTYPE=i386-pc-linux-gnu
MAIL=/var/mail/admin
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
PIPESTATUS=([0]="0")
PPID=26422
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS2='> '
PS4='+ '
PWD=/var/www/www.miila.com
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:his tory:interactive-comments:monitor
SHLVL=3
SSH_CLIENT='84.249.235.27 20104 22'
SSH_CONNECTION='84.249.235.27 20104 84.20.130.246 22'
SSH_TTY=/dev/pts/0
TERM=xterm
UID=10007
USER=web24_user1
_=
web24_user1@server1:/var/www/www.miila.com$


Is log name supposed to be Admin?

Hmmm....

Sam

Leszek
22nd April 2007, 14:35
Take a look here (http://www.codecoffee.com/tipsforlinux/articles/030.html).

SamTzu
22nd April 2007, 16:44
I read that article.

Could it be that path environment is wrong?
Shouldnt there be /bin/bash there?
If so how can I add it there?

Sam

Leszek
22nd April 2007, 18:34
I'm not really sure what's wrong.This variable is the same on my Debian system.
To how many accounts did you give administrator privileges ?

SamTzu
22nd April 2007, 18:44
Theres only 2 sites now.
All sites will have admin rights for their respective sites and have SSH marked.
Could it be that when sshroot is defined it marks down server IP address.
If the address is changed will that ruin sshroot?

Sam

Leszek
22nd April 2007, 19:03
Theres only 2 sites now.
All sites will have admin rights for their respective sites and have SSH marked.
You have to remember that one site can have only one administrator.ISPConfig should warn you about having more admin users.
Chroot should work after changing IPs.

SamTzu
23rd April 2007, 08:02
For chroot on SSH to work you need to activate SSH in the ISPConfig settings and patch the SSH server like it was done in this howto (http://www.howtoforge.com/chrooted_ssh_howto_debian).
After that this setting will make sense:
$go_info["server"]["ssh_chroot"] = 1;
and chrooting will work for new users.Others will be "free".
It seems that you maybe missing some files in your user's jail.For example in Debian it would be /var/www/your site's address/user/your user's name/bin. There are the needed files like:bash,ls,mkdir,mv,ping,pwd etc.
I guess that at least the first one isn't there.
Also the admin user isn't chrooted.


In this article it mentions /usr folder.
./configure --exec-prefix=/usr

Should I configure this to point in /var/www/ for ISPConfig?


Sam

till
23rd April 2007, 10:38
The prefix is fine, you dont have to change it for ISPConfig.

SamTzu
23rd April 2007, 14:43
I got it to work with the link you showed me...

http://www.howtoforge.com/chrooted_ssh_howto_debian

It works now even for the "old" accounts.

thx


Sam