SSH connection fails on users

Discussion in 'General' started by SamTzu, Apr 21, 2007.

  1. SamTzu

    SamTzu Active Member

    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
     
  2. Leszek

    Leszek Member

    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 ?
     
  3. SamTzu

    SamTzu Active Member

    Chroot

    Yes, chroot is in use.

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


    Sam
     
  4. Leszek

    Leszek Member

    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.
    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.
     
  5. SamTzu

    SamTzu Active Member

    Vm

    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
     
  6. SamTzu

    SamTzu Active Member

    set

    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:eek:r=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=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.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:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;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:history: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
     
  7. Leszek

    Leszek Member

    Take a look here.
     
    Last edited: Apr 22, 2007
  8. SamTzu

    SamTzu Active Member

    Path?

    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
     
  9. Leszek

    Leszek Member

    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 ?
     
  10. SamTzu

    SamTzu Active Member

    sshroot

    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
     
  11. Leszek

    Leszek Member

    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.
     
  12. SamTzu

    SamTzu Active Member

    chrooted


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

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


    Sam
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    The prefix is fine, you dont have to change it for ISPConfig.
     
  14. SamTzu

    SamTzu Active Member

Share This Page