chmod works on the local machine or over NFS mounts. There is no remote version of the command.
If you ssh into the remote system, the chmod commands are "local" to that remote system.
Whenever in doubt, check what the manpage says.
Now, you can limit ssh/scp/rsync/sftp access to specific users@specific client hostnames/IPs, but that isn't chmod. That is ssh. The sshd_config file has settings to limit which users from which remote systems can connect. Match is the keyword in that config file. For example, I don't allow any ssh-based access to my systems, except from one of my internal, trusted, subnets.
At the bottom of the sshd_config file, is
Code:
PasswordAuthentication no
Match Address 172.22.22.0/24,172.21.22.0/24,172.22.21.0/24
PasswordAuthentication yes
This says no passwords can be used, unless the client is from one of 3 subnets, then password-based authentication can be used. So, any other subnets (including the internet) must use either ssh-keys or ssh-certs for authentication.
In the OP, you wrote:
Code:
chmod -R servername#serveripaddress o=r /home/username
a) servername#serveripaddress isn't valid for any chmod command. Not ever.
b) o=r will set ------r-- permissions, so the user or any members of the group cannot access the file. "Other" means anyone who isn't the owner or in the group. It is highly unlikely you really want this. I suspect you want u=rwx,g=rwx,o=r ... or in octal, 774 (-rwxrwxr--). Much shorter that way. 664 would be -rw-rw-r-- and is also good for data. 644 would be fine too, -rw-r--r--
Seems a refresher on basic Unix permissions is needed. "Ubuntu permissions" web search will find a tutorial, but any Unix permissions tutorial is 100% fine and the same skills. There's no difference between all Unix-based permissions and what Ubuntu does.
Bookmarks