![ssh copy to nas ssh copy to nas](https://docs.qnap.com/operating-system/qts/4.2.x/cat1/zh-cn/73.png)
Git Remote Add With Another SSH Port (Not 22) - (2021) | Various resources I used in some way to get my Git server working and which, therefore, contributed to this post. To copy the NAS repo into a local folder, starting a new remote repo for the project.
#SSH COPY TO NAS PC#
cd git remote set-url origin git push origin main git branch -set-upstream-to origin/main In PC Terminal - Cloning NAS Repo into an Empty Local Folder: This can be used to switch from a GitHub remote to your NAS remote, to correct a mistyped path used with git remote add origin, etc. When your local repo already has a remote set. cd git remote add origin "] git push origin main git branch -set-upstream-to origin/main In PC Terminal - Change Local Repo’s Remote to NAS Repo: Using the NAS Repo on Local Machines In PC Terminal - Connect a Local Repo to NAS Bare Repo: (Side note: Though I got this warning, I did not experience any loss of access to my git-user’s folder from my other, admin-group account.) If you get a warning about being denied access to the shared folder, click Yes.
![ssh copy to nas ssh copy to nas](https://emby.media/community/uploads/inline/1276/5d829a1c93f8b_3.png)
Click on Permissions tab and click Advanced Options > Exclude inherited permissions.ssh folder in it), and click Properties to open the Properties window. Right-click on the homes folder for the git-user (the one with the.(Without this step, the SSH key will not work for authentication because permissions on the NAS SSH key file are too permissive.) Uncomment (remove “#” before) PubKeyAuthentication yes Save and exit file by pressing ESC, typing :wq, and pressing ENTER Exit NAS in Terminal (“SSH out of” NAS)Įxit In NAS via Browser: Fix git-user’s Home PermissionsĬhange permissions on homes/git-user to exclude all users but the git-user. SSH into NAS, and open sshd_config file with an Administrative User (not the default Admin user) ssh -p sudo vim /etc/ssh/sshd_config In sshd_config: ssh-copy-id -p -i ~/.ssh/id_ed25519.pub In NAS Terminal: Edit ‘sshd_config’ File Or you can use rsa: ssh-keygen -t rsa -b 4096 eval “$(ssh-agent -s)” ssh-add ~/.ssh/id_rsaĬopy SSH public key to NAS. Generate a new SSH key pair and add them to SSH agent. In PC Terminal - Generate an SSH Key Pair: NAS Terminal - for taking action within your NAS.PC Terminal - for taking action within your PC.For details about steps needed to set up git on NAS before setting up SSH see my other story. This guide only includes the steps to set up SSH with Git on a Synology DiskStation and some basic Git commands to initially set up the repo. Synology DiskStation (NAS) DSM 7: Setting Up Git and SSH For Password-less Use