Cannot create .ssh directory in /var/www/clients/clientX/webX

Discussion in 'Technical' started by SangeetK, Jan 13, 2017.

  1. SangeetK

    SangeetK New Member

    Hello,

    I am trying to create .ssh directory in /var/www/clients/clientX/webX but I get permission denied error even when I try as root. I need to copy my ssh keys so that I can deploy my laravel application using Deployer. Here are the logs:

    Trying initially as web2 user

    web2@dev:/var/www/clients/client2/web2$ id
    uid=5005(web2) gid=5006(client2) groups=5006(client2)
    web2@dev:/var/www/clients/client2/web2$ ls -al
    total 40
    drwxr-xr-x 10 web2 client2 4096 Jan 13 06:16 .
    drwxr-xr-x 3 root root 4096 Jan 13 05:32 ..
    drwxr-xr-x 2 web2 client2 4096 Jan 13 05:32 cgi-bin
    drwxr-xr-x 3 root root 4096 Jan 13 06:16 home
    drwxr-xr-x 2 root root 4096 Jan 13 05:32 log
    drwx--x--- 2 web2 client2 4096 Jan 13 05:32 private
    drwxr-xr-x 2 root root 4096 Jan 13 05:32 ssl
    drwxrwx--- 2 web2 client2 4096 Jan 13 05:32 tmp
    drwx--x--x 7 web2 client2 4096 Jan 13 07:30 web
    drwx--x--- 2 web2 client2 4096 Jan 13 05:32 webdav
    web2@dev:/var/www/clients/client2/web2$ mkdir .ssh
    mkdir: cannot create directory '.ssh': Permission denied
    web2@dev:/var/www/clients/client2/web2$​

    Trying again as root

    root@dev:/var/www/clients/client2/web2# id
    uid=0(root) gid=0(root) groups=0(root)
    root@dev:/var/www/clients/client2/web2# ls -al
    total 40
    drwxr-xr-x 10 web2 client2 4096 Jan 13 06:16 .
    drwxr-xr-x 3 root root 4096 Jan 13 05:32 ..
    drwxr-xr-x 2 web2 client2 4096 Jan 13 05:32 cgi-bin
    drwxr-xr-x 3 root root 4096 Jan 13 06:16 home
    drwxr-xr-x 2 root root 4096 Jan 13 05:32 log
    drwx--x--- 2 web2 client2 4096 Jan 13 05:32 private
    drwxr-xr-x 2 root root 4096 Jan 13 05:32 ssl
    drwxrwx--- 2 web2 client2 4096 Jan 13 05:32 tmp
    drwx--x--x 7 web2 client2 4096 Jan 13 07:30 web
    drwx--x--- 2 web2 client2 4096 Jan 13 05:32 webdav
    root@dev:/var/www/clients/client2/web2# mkdir .ssh
    mkdir: cannot create directory '.ssh': Permission denied
    root@dev:/var/www/clients/client2/web2#​

    Thanks in Advance.
    Sangeet Kumar
     
    Last edited: Jan 13, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    chattr -i /var/www/clients/client2/web2
    mkdir /var/www/clients/client2/web2/.ssh
    chattr +1 /var/www/clients/client2/web2
     
  3. SangeetK

    SangeetK New Member

    Thanks Till. You saved lots of my time :)
     

Share This Page