SSH users can't use unzip

Discussion in 'Server Operation' started by lobius, Apr 9, 2012.

  1. lobius

    lobius Member

    They can use tar just fine.

    The problem is that joomla backs up to a zip file.

    Is there a file I can edit to allow this command?

    Also, it seems that the FTP user can see things in their particular root that they cannot see in SSH.

    All directories list(ls) under the user root of FTP. Nothing lists in the user root of SSH.

    How do I get SSH to show directories in the user root?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Does the unzip command exist? What's the output of
    Code:
    which unzip
    ?
     
  3. lobius

    lobius Member

    Yes, I know it is crazy but it does, in fact, exist.

    /usr/bin/unzip

    I went around the problem by opening the archive on my desktop and sending it to the server. Everything is local so it went very quickly.

    sudo su asks me for the password to web1's account.

    What would that be? Client 1's FTP, shell… I can't figure it out.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    sudo su asks for the password of the user as which you are currently logged in.
     
  5. lobius

    lobius Member

    Of course, falko. That is what it should be. It seems, however, that when a user logs in to their SSH account created by ISPconfig3, there's a different password.

    Maybe I missed it.

    Code:
    login as: rex_SSH
    [email protected]'s password:
    Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-12-generic-pae i686)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Thu Apr 12 19:54:13 EDT 2012
    
      System load:  0.05              Processes:           97
      Usage of /:   3.1% of 54.29GB   Users logged in:     0
      Memory usage: 54%               IP address for eth0: 192.168.1.107
      Swap usage:   14%
    
      Graph this data and manage this system at https://landscape.canonical.com/
    Last login: Tue Apr 10 12:10:50 2012 from 192.168.1.124
    
    web1@rule303:~$ sudo su
    [sudo] password for web1:
    Sorry, try again.
    [sudo] password for web1:
    
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Is it possible that rex_SSH uses the same user ID as web1? Please check /etc/passwd.
     
  7. lobius

    lobius Member

    Here are the lines in question…

    Code:
    web1:x:5004:5005::/var/www/clients/client1/web1:/bin/false
    rex_SSH:x:5004:5005::/var/www/clients/client1/web1:/bin/bash
    
    The only one real difference looks like the ends with false vs. bash.

    What I'm trying to figure out is the permissions of a shell user without sudo. It's a good sign that they can't do that but… They have to be able to do some tasks or there is no point to it. Right now, it looks more restrictive than surveillance state monkeys like go daddy.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Both users have the same ID. I suggest you recreate the rex_SSH user with an unused ID (best below 5000).
     
  9. lobius

    lobius Member

    How did they both get the same ID? Is that a bug?

    I set it up in a ISPconfig3.
     
  10. lobius

    lobius Member

    Take a look at this…

    Code:
    [email protected]:~$ ls
    [email protected]:~$ cd web
    bash: cd: web: No such file or directory
    [email protected]:~$ cd /web
    [email protected]:/web$ ls
    LICENSE.txt    configuration.php    index.php       media       tmp
    README.txt     custom_code          installation    modules     web.config.txt
    administrator  error                joomla.tar.bz2  plugins
    cache          eurofxref-daily.xml  language        robots.txt
    cli            images               libraries       stats
    components     includes             logs            templates
    [email protected]:/web$ sudo chown -R www-data:www-data
    bash: sudo: command not found
    [email protected]:/web$
    
    Can not executed basic staff to get joomla started.

    What is the point of shell for clients?
     
  11. lobius

    lobius Member

    Of course, works as root.

    Code:
    root@rule303:~# cd /var/www/clients/client2/web4
    root@rule303:/var/www/clients/client2/web4# cd web
    root@rule303:/var/www/clients/client2/web4/web# ls
    administrator      eurofxref-daily.xml  libraries    robots.txt
    cache              images               LICENSE.txt  stats
    cli                includes             logs         templates
    components         index.php            media        tmp
    configuration.php  installation         modules      web.config.txt
    custom_code        joomla.tar.bz2       plugins
    error              language             README.txt
    root@rule303:/var/www/clients/client2/web4/web# chown -R www-data:www-data /var/www/clients/client2/web4/web
    root@rule303:/var/www/clients/client2/web4/web# find . -type f -exec chmod 644 {} \;
    root@rule303:/var/www/clients/client2/web4/web# find . -type d -exec chmod 755 {} \;
    root@rule303:/var/www/clients/client2/web4/web#
    
    Is there a way to fine tune the permissions without a blanket on/off for the jail kit?
     
  12. Peter Richardson

    Peter Richardson New Member

    any update on this? SSH user can't actually do anything. There is not enough information in the manual to explain the details. The manual needs to be improved so that users who are learning can have the opportunity to fully understand SSH users, their permissions, the jailkit options (which I'm still unsure about) and figure out why SSH users can't do anything. Can someone please help?
     
  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    It is better not to hijack a thread though you may think the problem is similar to yours. Either ways, if you believe so, you can try follow @falko suggestion in reply #6 and #8. Otherwise, provide more details on your problems or errors, preferably in your own thread.
     
    Last edited: Nov 1, 2018
  14. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    SSH users work OK for me with Jail. Jailkit documentation explains how the needed commands and libraries can be included in the jail. Like @ahrasis wrote, provide more details on what is not working and how the SSH user is set up.
     
    ahrasis likes this.

Share This Page