I wrote a very simple script that should allow me to create directories with specific permissions on a remote server.
I used the command to execute the script to the remote server:
stan@192.168.159.133 /root/Documents/script
And I got this answer:
bash: /root/Documents/script: Permission denied
Connection to 192.168.159.133 closed.
I'm working on Fedora 20, and the server is on Ubuntu 18.04.1.
I tried to modify the permission on my script document with chmod:
chmod 777 script
At first I tried to execute the script with the SSL connection integrated inside of the script (you can see it in my script).
I tried to read several posts, but for most of the answers my knowledge is still too weak to understand everything.
#!/bin/bash
#Connecting to Ubuntu Server
#ssh stan@192.168.159.133
#specifying the directory where I want to create my two directories
cd /home/stan
#Creating the first directory "PublicFolder" and assigning permissions
mkdir PublicFolder
chmod -R 606 PublicFolder
#Creating the first directory "PrivateFolder" and assigning permissions
PrivateFolder
chmod -R 604 PrivateFolder