Permission problem running touch through ssh command (but not with ssh access)non root ssh keys helpWhy is my ssh connection unauthorized although I have updated my key on the remote machine?Webserver-User has no Shell-Access but needs SSH-Keys or Permission change of directory?How do I stop ssh-agent trying all keys with agent forwarding?SSH pageant not workingSSH Remote Execution - checking server can do it?Why is my SSH connection being closed immediately after pubkey auth succeeds?SSH Configuration Help / Can't tunnelAws ec2 - How to rsync files between two remotes?passwordless ssh to localhost in Ubuntu 16.04

What does "Puller Prush Person" mean?

Why Is Death Allowed In the Matrix?

Do I have a twin with permutated remainders?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

The use of multiple foreign keys on same column in SQL Server

Why is consensus so controversial in Britain?

Why was the small council so happy for Tyrion to become the Master of Coin?

What are these boxed doors outside store fronts in New York?

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

Why not use SQL instead of GraphQL?

How much RAM could one put in a typical 80386 setup?

Adding span tags within wp_list_pages list items

How can I make my BBEG immortal short of making them a Lich or Vampire?

Replacing matching entries in one column of a file by another column from a different file

Pattern match does not work in bash script

Font hinting is lost in Chrome-like browsers (for some languages )

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

What's the point of deactivating Num Lock on login screens?

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

How does one intimidate enemies without having the capacity for violence?

How is it possible to have an ability score that is less than 3?

Today is the Center

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Equivalence principle before Einstein



Permission problem running touch through ssh command (but not with ssh access)


non root ssh keys helpWhy is my ssh connection unauthorized although I have updated my key on the remote machine?Webserver-User has no Shell-Access but needs SSH-Keys or Permission change of directory?How do I stop ssh-agent trying all keys with agent forwarding?SSH pageant not workingSSH Remote Execution - checking server can do it?Why is my SSH connection being closed immediately after pubkey auth succeeds?SSH Configuration Help / Can't tunnelAws ec2 - How to rsync files between two remotes?passwordless ssh to localhost in Ubuntu 16.04






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I run a remote script through ssh and get permission errors on touch, while everything works fine if I connect through ssh using the same key. The script is executed, echoes are run for example.



Here is the code I run:



ssh -Tv user@149.202.xxx.xxx 'bash var/deploy.sh'


Here is the content of the script:



#!/bin/bash
echo "blabla"
touch bidule
ln -sfn www-26 www


Here is the result of the command:



debug1: Reading configuration data /Users/local_user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 149.202.xxx.xxx [149.202.xxx.xxx] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/local_user/.ssh/id_rsa type -1
...
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5p1 Ubuntu-10ubuntu0.1
debug1: match: OpenSSH_7.5p1 Ubuntu-10ubuntu0.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 149.202.xxx.xxx:22 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:sSTBN/oPCEhmpaK2UKIU1DC1uhlGB3F0II2TDfHi5eA
debug1: Host '149.202.xxx.xxx' is known and matches the ECDSA host key.
debug1: Found key in /Users/local_user/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/local_user/.ssh/local_user_mac
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug1: Authentication succeeded (publickey).
Authenticated to 149.202.xxx.xxx ([149.202.xxx.xxx]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LC_CTYPE = UTF-8
debug1: Sending command: bash var/deploy.sh
blabla
touch: cannot touch 'bidule': Permission denied
ln: failed to create symbolic link 'www': Permission denied
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 4144, received 2844 bytes, in 0.4 seconds
Bytes per second: sent 10803.0, received 7414.0
debug1: Exit status 1


I also tried various options with ssh (-ttv, -Tv, -v) and always get the same answer.



Note that if I use the same key and simply go with a
ssh user@149.202.xxx.xxx
and then run bash var/deploy.sh from the command line, it works fine.



Also note that all the content of this directory is uploaded via sftp using the same key.



Context:



Server os:



Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful


Client (where the ssh command is used): bitbucket pipeline instance or mac OSX for local tests.



For information here is the permissions on the var directory:



[10:39:32] iam.test.edu-sante.com@Dagobert:~/var$ ls -rtla
total 48
drwxr-xr-x 4 root root 4096 Mar 26 14:37 ..
-rw-r--r-- 1 user group 58 Mar 26 17:46 deploy.sh
drwxr-xr-x 3 user group 4096 Mar 26 17:46 www-26
...
lrwxrwxrwx 1 user group 6 Mar 27 10:13 www -> www-24
drwxr-xr-x 11 user group 4096 Mar 27 10:13 .


Note that the var directory here isn't the /var directory it's a $HOME/var directory specific to the user.



And just in case here is my sshd config file:



# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 2m
PermitRootLogin no
StrictModes yes
MaxAuthTries 6
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PasswordAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
Match group sftp
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no


User isn't part of the sftp group.










share|improve this question






























    0















    I run a remote script through ssh and get permission errors on touch, while everything works fine if I connect through ssh using the same key. The script is executed, echoes are run for example.



    Here is the code I run:



    ssh -Tv user@149.202.xxx.xxx 'bash var/deploy.sh'


    Here is the content of the script:



    #!/bin/bash
    echo "blabla"
    touch bidule
    ln -sfn www-26 www


    Here is the result of the command:



    debug1: Reading configuration data /Users/local_user/.ssh/config
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: Applying options for *
    debug1: Connecting to 149.202.xxx.xxx [149.202.xxx.xxx] port 22.
    debug1: Connection established.
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/local_user/.ssh/id_rsa type -1
    ...
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.9
    debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5p1 Ubuntu-10ubuntu0.1
    debug1: match: OpenSSH_7.5p1 Ubuntu-10ubuntu0.1 pat OpenSSH* compat 0x04000000
    debug1: Authenticating to 149.202.xxx.xxx:22 as 'user'
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
    debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ecdsa-sha2-nistp256 SHA256:sSTBN/oPCEhmpaK2UKIU1DC1uhlGB3F0II2TDfHi5eA
    debug1: Host '149.202.xxx.xxx' is known and matches the ECDSA host key.
    debug1: Found key in /Users/local_user/.ssh/known_hosts:1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /Users/local_user/.ssh/local_user_mac
    debug1: Server accepts key: pkalg ssh-rsa blen 535
    debug1: Authentication succeeded (publickey).
    Authenticated to 149.202.xxx.xxx ([149.202.xxx.xxx]:22).
    debug1: channel 0: new [client-session]
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
    debug1: Sending environment.
    debug1: Sending env LC_CTYPE = UTF-8
    debug1: Sending command: bash var/deploy.sh
    blabla
    touch: cannot touch 'bidule': Permission denied
    ln: failed to create symbolic link 'www': Permission denied
    debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
    debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
    debug1: channel 0: free: client-session, nchannels 1
    Transferred: sent 4144, received 2844 bytes, in 0.4 seconds
    Bytes per second: sent 10803.0, received 7414.0
    debug1: Exit status 1


    I also tried various options with ssh (-ttv, -Tv, -v) and always get the same answer.



    Note that if I use the same key and simply go with a
    ssh user@149.202.xxx.xxx
    and then run bash var/deploy.sh from the command line, it works fine.



    Also note that all the content of this directory is uploaded via sftp using the same key.



    Context:



    Server os:



    Distributor ID: Ubuntu
    Description: Ubuntu 17.10
    Release: 17.10
    Codename: artful


    Client (where the ssh command is used): bitbucket pipeline instance or mac OSX for local tests.



    For information here is the permissions on the var directory:



    [10:39:32] iam.test.edu-sante.com@Dagobert:~/var$ ls -rtla
    total 48
    drwxr-xr-x 4 root root 4096 Mar 26 14:37 ..
    -rw-r--r-- 1 user group 58 Mar 26 17:46 deploy.sh
    drwxr-xr-x 3 user group 4096 Mar 26 17:46 www-26
    ...
    lrwxrwxrwx 1 user group 6 Mar 27 10:13 www -> www-24
    drwxr-xr-x 11 user group 4096 Mar 27 10:13 .


    Note that the var directory here isn't the /var directory it's a $HOME/var directory specific to the user.



    And just in case here is my sshd config file:



    # $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
    Port 22
    Protocol 2
    HostKey /etc/ssh/ssh_host_rsa_key
    HostKey /etc/ssh/ssh_host_ecdsa_key
    HostKey /etc/ssh/ssh_host_ed25519_key
    UsePrivilegeSeparation yes
    SyslogFacility AUTH
    LogLevel INFO
    LoginGraceTime 2m
    PermitRootLogin no
    StrictModes yes
    MaxAuthTries 6
    RSAAuthentication yes
    PubkeyAuthentication yes
    AuthorizedKeysFile %h/.ssh/authorized_keys
    IgnoreRhosts yes
    RhostsRSAAuthentication no
    HostbasedAuthentication no
    PasswordAuthentication no
    PermitEmptyPasswords no
    ChallengeResponseAuthentication no
    UsePAM yes
    X11Forwarding yes
    PrintMotd no
    AcceptEnv LANG LC_*
    Subsystem sftp /usr/lib/openssh/sftp-server
    Match group sftp
    ChrootDirectory %h
    ForceCommand internal-sftp
    AllowTcpForwarding no


    User isn't part of the sftp group.










    share|improve this question


























      0












      0








      0








      I run a remote script through ssh and get permission errors on touch, while everything works fine if I connect through ssh using the same key. The script is executed, echoes are run for example.



      Here is the code I run:



      ssh -Tv user@149.202.xxx.xxx 'bash var/deploy.sh'


      Here is the content of the script:



      #!/bin/bash
      echo "blabla"
      touch bidule
      ln -sfn www-26 www


      Here is the result of the command:



      debug1: Reading configuration data /Users/local_user/.ssh/config
      debug1: Reading configuration data /etc/ssh/ssh_config
      debug1: /etc/ssh/ssh_config line 21: Applying options for *
      debug1: Connecting to 149.202.xxx.xxx [149.202.xxx.xxx] port 22.
      debug1: Connection established.
      debug1: key_load_public: No such file or directory
      debug1: identity file /Users/local_user/.ssh/id_rsa type -1
      ...
      debug1: Enabling compatibility mode for protocol 2.0
      debug1: Local version string SSH-2.0-OpenSSH_6.9
      debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5p1 Ubuntu-10ubuntu0.1
      debug1: match: OpenSSH_7.5p1 Ubuntu-10ubuntu0.1 pat OpenSSH* compat 0x04000000
      debug1: Authenticating to 149.202.xxx.xxx:22 as 'user'
      debug1: SSH2_MSG_KEXINIT sent
      debug1: SSH2_MSG_KEXINIT received
      debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
      debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
      debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
      debug1: Server host key: ecdsa-sha2-nistp256 SHA256:sSTBN/oPCEhmpaK2UKIU1DC1uhlGB3F0II2TDfHi5eA
      debug1: Host '149.202.xxx.xxx' is known and matches the ECDSA host key.
      debug1: Found key in /Users/local_user/.ssh/known_hosts:1
      debug1: SSH2_MSG_NEWKEYS sent
      debug1: expecting SSH2_MSG_NEWKEYS
      debug1: SSH2_MSG_NEWKEYS received
      debug1: SSH2_MSG_SERVICE_REQUEST sent
      debug1: SSH2_MSG_SERVICE_ACCEPT received
      debug1: Authentications that can continue: publickey
      debug1: Next authentication method: publickey
      debug1: Offering RSA public key: /Users/local_user/.ssh/local_user_mac
      debug1: Server accepts key: pkalg ssh-rsa blen 535
      debug1: Authentication succeeded (publickey).
      Authenticated to 149.202.xxx.xxx ([149.202.xxx.xxx]:22).
      debug1: channel 0: new [client-session]
      debug1: Requesting no-more-sessions@openssh.com
      debug1: Entering interactive session.
      debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
      debug1: Sending environment.
      debug1: Sending env LC_CTYPE = UTF-8
      debug1: Sending command: bash var/deploy.sh
      blabla
      touch: cannot touch 'bidule': Permission denied
      ln: failed to create symbolic link 'www': Permission denied
      debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
      debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
      debug1: channel 0: free: client-session, nchannels 1
      Transferred: sent 4144, received 2844 bytes, in 0.4 seconds
      Bytes per second: sent 10803.0, received 7414.0
      debug1: Exit status 1


      I also tried various options with ssh (-ttv, -Tv, -v) and always get the same answer.



      Note that if I use the same key and simply go with a
      ssh user@149.202.xxx.xxx
      and then run bash var/deploy.sh from the command line, it works fine.



      Also note that all the content of this directory is uploaded via sftp using the same key.



      Context:



      Server os:



      Distributor ID: Ubuntu
      Description: Ubuntu 17.10
      Release: 17.10
      Codename: artful


      Client (where the ssh command is used): bitbucket pipeline instance or mac OSX for local tests.



      For information here is the permissions on the var directory:



      [10:39:32] iam.test.edu-sante.com@Dagobert:~/var$ ls -rtla
      total 48
      drwxr-xr-x 4 root root 4096 Mar 26 14:37 ..
      -rw-r--r-- 1 user group 58 Mar 26 17:46 deploy.sh
      drwxr-xr-x 3 user group 4096 Mar 26 17:46 www-26
      ...
      lrwxrwxrwx 1 user group 6 Mar 27 10:13 www -> www-24
      drwxr-xr-x 11 user group 4096 Mar 27 10:13 .


      Note that the var directory here isn't the /var directory it's a $HOME/var directory specific to the user.



      And just in case here is my sshd config file:



      # $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
      Port 22
      Protocol 2
      HostKey /etc/ssh/ssh_host_rsa_key
      HostKey /etc/ssh/ssh_host_ecdsa_key
      HostKey /etc/ssh/ssh_host_ed25519_key
      UsePrivilegeSeparation yes
      SyslogFacility AUTH
      LogLevel INFO
      LoginGraceTime 2m
      PermitRootLogin no
      StrictModes yes
      MaxAuthTries 6
      RSAAuthentication yes
      PubkeyAuthentication yes
      AuthorizedKeysFile %h/.ssh/authorized_keys
      IgnoreRhosts yes
      RhostsRSAAuthentication no
      HostbasedAuthentication no
      PasswordAuthentication no
      PermitEmptyPasswords no
      ChallengeResponseAuthentication no
      UsePAM yes
      X11Forwarding yes
      PrintMotd no
      AcceptEnv LANG LC_*
      Subsystem sftp /usr/lib/openssh/sftp-server
      Match group sftp
      ChrootDirectory %h
      ForceCommand internal-sftp
      AllowTcpForwarding no


      User isn't part of the sftp group.










      share|improve this question
















      I run a remote script through ssh and get permission errors on touch, while everything works fine if I connect through ssh using the same key. The script is executed, echoes are run for example.



      Here is the code I run:



      ssh -Tv user@149.202.xxx.xxx 'bash var/deploy.sh'


      Here is the content of the script:



      #!/bin/bash
      echo "blabla"
      touch bidule
      ln -sfn www-26 www


      Here is the result of the command:



      debug1: Reading configuration data /Users/local_user/.ssh/config
      debug1: Reading configuration data /etc/ssh/ssh_config
      debug1: /etc/ssh/ssh_config line 21: Applying options for *
      debug1: Connecting to 149.202.xxx.xxx [149.202.xxx.xxx] port 22.
      debug1: Connection established.
      debug1: key_load_public: No such file or directory
      debug1: identity file /Users/local_user/.ssh/id_rsa type -1
      ...
      debug1: Enabling compatibility mode for protocol 2.0
      debug1: Local version string SSH-2.0-OpenSSH_6.9
      debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5p1 Ubuntu-10ubuntu0.1
      debug1: match: OpenSSH_7.5p1 Ubuntu-10ubuntu0.1 pat OpenSSH* compat 0x04000000
      debug1: Authenticating to 149.202.xxx.xxx:22 as 'user'
      debug1: SSH2_MSG_KEXINIT sent
      debug1: SSH2_MSG_KEXINIT received
      debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
      debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
      debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
      debug1: Server host key: ecdsa-sha2-nistp256 SHA256:sSTBN/oPCEhmpaK2UKIU1DC1uhlGB3F0II2TDfHi5eA
      debug1: Host '149.202.xxx.xxx' is known and matches the ECDSA host key.
      debug1: Found key in /Users/local_user/.ssh/known_hosts:1
      debug1: SSH2_MSG_NEWKEYS sent
      debug1: expecting SSH2_MSG_NEWKEYS
      debug1: SSH2_MSG_NEWKEYS received
      debug1: SSH2_MSG_SERVICE_REQUEST sent
      debug1: SSH2_MSG_SERVICE_ACCEPT received
      debug1: Authentications that can continue: publickey
      debug1: Next authentication method: publickey
      debug1: Offering RSA public key: /Users/local_user/.ssh/local_user_mac
      debug1: Server accepts key: pkalg ssh-rsa blen 535
      debug1: Authentication succeeded (publickey).
      Authenticated to 149.202.xxx.xxx ([149.202.xxx.xxx]:22).
      debug1: channel 0: new [client-session]
      debug1: Requesting no-more-sessions@openssh.com
      debug1: Entering interactive session.
      debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
      debug1: Sending environment.
      debug1: Sending env LC_CTYPE = UTF-8
      debug1: Sending command: bash var/deploy.sh
      blabla
      touch: cannot touch 'bidule': Permission denied
      ln: failed to create symbolic link 'www': Permission denied
      debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
      debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
      debug1: channel 0: free: client-session, nchannels 1
      Transferred: sent 4144, received 2844 bytes, in 0.4 seconds
      Bytes per second: sent 10803.0, received 7414.0
      debug1: Exit status 1


      I also tried various options with ssh (-ttv, -Tv, -v) and always get the same answer.



      Note that if I use the same key and simply go with a
      ssh user@149.202.xxx.xxx
      and then run bash var/deploy.sh from the command line, it works fine.



      Also note that all the content of this directory is uploaded via sftp using the same key.



      Context:



      Server os:



      Distributor ID: Ubuntu
      Description: Ubuntu 17.10
      Release: 17.10
      Codename: artful


      Client (where the ssh command is used): bitbucket pipeline instance or mac OSX for local tests.



      For information here is the permissions on the var directory:



      [10:39:32] iam.test.edu-sante.com@Dagobert:~/var$ ls -rtla
      total 48
      drwxr-xr-x 4 root root 4096 Mar 26 14:37 ..
      -rw-r--r-- 1 user group 58 Mar 26 17:46 deploy.sh
      drwxr-xr-x 3 user group 4096 Mar 26 17:46 www-26
      ...
      lrwxrwxrwx 1 user group 6 Mar 27 10:13 www -> www-24
      drwxr-xr-x 11 user group 4096 Mar 27 10:13 .


      Note that the var directory here isn't the /var directory it's a $HOME/var directory specific to the user.



      And just in case here is my sshd config file:



      # $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
      Port 22
      Protocol 2
      HostKey /etc/ssh/ssh_host_rsa_key
      HostKey /etc/ssh/ssh_host_ecdsa_key
      HostKey /etc/ssh/ssh_host_ed25519_key
      UsePrivilegeSeparation yes
      SyslogFacility AUTH
      LogLevel INFO
      LoginGraceTime 2m
      PermitRootLogin no
      StrictModes yes
      MaxAuthTries 6
      RSAAuthentication yes
      PubkeyAuthentication yes
      AuthorizedKeysFile %h/.ssh/authorized_keys
      IgnoreRhosts yes
      RhostsRSAAuthentication no
      HostbasedAuthentication no
      PasswordAuthentication no
      PermitEmptyPasswords no
      ChallengeResponseAuthentication no
      UsePAM yes
      X11Forwarding yes
      PrintMotd no
      AcceptEnv LANG LC_*
      Subsystem sftp /usr/lib/openssh/sftp-server
      Match group sftp
      ChrootDirectory %h
      ForceCommand internal-sftp
      AllowTcpForwarding no


      User isn't part of the sftp group.







      ubuntu ssh






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 0:48









      Rui F Ribeiro

      41.9k1483142




      41.9k1483142










      asked Mar 27 at 11:20









      Jean-Xavier RaynaudJean-Xavier Raynaud

      31




      31




















          1 Answer
          1






          active

          oldest

          votes


















          1














          It seems you want to run the script in the ~/var directory, but currently it is run in the home directory.



          The command bash var/deploy.sh does not switch to the var directory, and touch bidule tries to create a file in the current directory, which is likely the user's home directory.






          share|improve this answer























          • One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

            – Kusalananda
            Mar 27 at 11:45











          • Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

            – Jean-Xavier Raynaud
            Mar 28 at 12:21











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508952%2fpermission-problem-running-touch-through-ssh-command-but-not-with-ssh-access%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          It seems you want to run the script in the ~/var directory, but currently it is run in the home directory.



          The command bash var/deploy.sh does not switch to the var directory, and touch bidule tries to create a file in the current directory, which is likely the user's home directory.






          share|improve this answer























          • One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

            – Kusalananda
            Mar 27 at 11:45











          • Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

            – Jean-Xavier Raynaud
            Mar 28 at 12:21















          1














          It seems you want to run the script in the ~/var directory, but currently it is run in the home directory.



          The command bash var/deploy.sh does not switch to the var directory, and touch bidule tries to create a file in the current directory, which is likely the user's home directory.






          share|improve this answer























          • One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

            – Kusalananda
            Mar 27 at 11:45











          • Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

            – Jean-Xavier Raynaud
            Mar 28 at 12:21













          1












          1








          1







          It seems you want to run the script in the ~/var directory, but currently it is run in the home directory.



          The command bash var/deploy.sh does not switch to the var directory, and touch bidule tries to create a file in the current directory, which is likely the user's home directory.






          share|improve this answer













          It seems you want to run the script in the ~/var directory, but currently it is run in the home directory.



          The command bash var/deploy.sh does not switch to the var directory, and touch bidule tries to create a file in the current directory, which is likely the user's home directory.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 27 at 11:25









          SjoerdSjoerd

          32328




          32328












          • One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

            – Kusalananda
            Mar 27 at 11:45











          • Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

            – Jean-Xavier Raynaud
            Mar 28 at 12:21

















          • One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

            – Kusalananda
            Mar 27 at 11:45











          • Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

            – Jean-Xavier Raynaud
            Mar 28 at 12:21
















          One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

          – Kusalananda
          Mar 27 at 11:45





          One solution would be to cd to the correct directory before calling the script, another one would be to let the script do the cd (which I personally would have done).

          – Kusalananda
          Mar 27 at 11:45













          Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

          – Jean-Xavier Raynaud
          Mar 28 at 12:21





          Hi sorry for the stupid question and thanks for the answer. I wasn't able to upvote you as I don't have the needed reputation, but I would have otherwise

          – Jean-Xavier Raynaud
          Mar 28 at 12:21

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508952%2fpermission-problem-running-touch-through-ssh-command-but-not-with-ssh-access%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          -ssh, ubuntu

          Popular posts from this blog

          Word for a person who has no opinion about whether god existsWord for having a definite opinion while simultaneously withholding judgment?What's the opposite of “newcomer? Is ”veteran" OK?What do you call an “atheist” who might believe in an afterlife?What's a word for someone who wants to voice opinions but not have them challenged?Word for someone who dismisses contrary opinions as irrational?Somone who thinks they are overly special/out of the ordinaryIs there a word, phrase or idiom for “a person who is incapable of thinking about the future”?The belief that a god is human-likeA word for a non-famous person/thing you have heard a lot aboutAdjective for a person who enjoys taking care of their appearance

          What was this official D&D 3.5e Lovecraft-flavored rulebook?What was this set of RPG tools called?As a first-time DM should I let my players play complex character classes and roles?Nymph's Kiss and the RelationshipWhat was the name of this Cleric Prestige Class that shapes metal with its bare hands?Are the 3.5e Dragonlance books third party or official works?What's up with the domain Vile Darkness?What was this 80s book about RPGs?What was the name of this Werewolf band?What book had Rituals to “upgrade” animal companions to keep them viable at higher levels?What was this RPG that had rules for player-owned businesses?

          2017 IndyCar Series Contents Series news Teams and drivers Schedule Season summary Footnotes References External links Navigation menu"INDYCAR: Initial 2018 bodywork concepts unveiled"the original"IndyCar confirms switch to Performance Friction brakes in 2017""AJ Foyt Racing will switch to Chevy"the original"Carlos Munoz, Conor Daly will drive for AJ Foyt Racing""Zach Veach's Indy 500 Debut Confirmed with Foyt""No mass exodus from Honda after Ganassi switch""Ex-F1 driver Sato joins Andretti Autosport for 2017 IndyCar season""IndyCar's Ryan Hunter-Reay, sponsor DHL paired through 2020""hhgregg and Andretti Autosport announce partnership for key races in 2016""INDYCAR: Rossi re-signs with Andretti"the original"McLaren Formula 1 - Fernando Alonso to race at Indy 500 with McLaren, Honda and Andretti Autosport""Shank will finally take part in Indy 500 with Harvey, Andretti | MotorSportsTalk""Andretti adds Jack Harvey to Indy 500 field""Ganassi switches to Honda power for 2017""INDYCAR: Chilton returns to Ganassi"the original"IndyCar silly season: Who's going where in 2017?""INDYCAR: Kanaan, NTT Data return to Ganassi"the original"Kimball to remain at Ganassi for 2017""Coyne confirms Bourdais for 2017 IndyCar season""Davison to sub for Bourdais in Indy 500"the original"Gutierrez confirmed for Detroit IndyCar debut""Gutierrez returns with Coyne for rest of 2017 season""Vautier to drive for Coyne at Texas"the original"INDYCAR: Coyne confirms Jones for 2017"the original"Pippa Mann returns to Coyne for Indy 500""Karam, Dreyer & Reinbold teaming up again for Indianapolis 500""Pigot to return to Ed Carpenter Racing""Hildebrand confirmed as full-time Ed Carpenter driver""Veach to replace injured Hildebrand at Barber"the originalNew Team Harding Racing Enters Chaves for 101st Indianapolis 500"Juncos Racing Announces Entry in 101st Running of the Indianapolis 500 :: Juncos Racing""Juncos confirms Pigot for Indy 500""Saavedra confirmed in Juncos' second 500 entry"the original"Lazier confirms Indy 500 run after son's USF2000 debut"the original"Claman DeMelo to race for RLLR at Sonoma"the original"Rahal signs Servia and ace engineer for 2017""IndyCar: Aleshin returns with Schmidt"the original"Aleshin replaced by Saavedra for Toronto""Jack Harvey will pilot SPM No. 7 car at Watkins Glen, Sonoma""Jay Howard confirmed in Tony Stewart's supported SPM Indy entry""INDYCAR: Newgarden to wave the flag at Penske"the original"Pagenaud opts for No. 1 in 2017"the original"Penske confirms Newgarden for 2017""Montoya to stay with Team Penske in 2017""Target leaving IndyCar after 27 seasons with Chip Ganassi""Cavin: IndyCar could see complete driver/team shakeup in 2017""End of the road for KV Racing?""KV Racing confirms closure, equipment sold to Juncos""Juncos confirms IndyCar Series entry"the original"Juncos readies IndyCar program, aims for '17 500"the original"Harding Racing to add Texas, Pocono to schedule"the original"Sato signs with Andretti Autosport for 2017""INDYCAR: Aleshin in Doubt at SPM"the original"Long Beach notebook: JR Hildebrand breaks hand""Hildebrand cleared to return at Phoenix"the original"Bourdais to undergo surgery on multiple fractures""Aleshin loses Schmidt Peterson IndyCar ride""Saavedra in at SPM for Pocono, Gateway"the original"Bourdais to make return at Gateway"the original"The IndyCar Grand Prix no longer is sponsored by Angie's List""2017 IndyCar Series rulebook""2017 Verizon IndyCar Series Official Rulebook"Official websiteeeeee