Search the Community
Showing results for tags 'winscp'.
FrostByte posted a topic in Tutorials and GuidesWinSCP is a popular SFTP client and FTP client for Microsoft Windows which can be used as a GUI alternative to Putty or Terminal. The procedures below will allow you to perform tasks as Superuser just like you can with Putty or Terminal. If you do not need superuser access with WinSCP and just want to access your NAS using Admin then skip the steps (2, 3, and 6) in blue. 1. Enable SSH on Synology NAS Open DSM Control Panel Click Terminal & SNMP Click Terminal tab Check "Enable SSH service" Click "Apply" 2. Create script to modify sudoers config file on Synology NAS This script modifies the sudoers file which is needed to prevent DSM from prompting administrators only for the Admin password again when switching to superuser during the login process as WinSCP can't handle this prompt. This script is saved to rerun again later because DSM updates tend to overwrite any changes to the sudoers file. Open DSM Control Panel Click Task Scheduler Create a Scheduled Task - User-defined script Click General Tab Set task name "Reset Sudoers" Set user as "root" Uncheck "Enabled" box Click Task Setting tab Copy/paste the following into the Run command box cat <<EOF > /etc/sudoers Defaults syslog=authpriv root ALL=(ALL) ALL %administrators ALL=NOPASSWD: ALL EOF chmod ug=r,o= /etc/sudoers Click OK 3. Run the "Reset Sudoers" script on Synology NAS This step will need to be rerun whenever a DSM update puts your sudoers file back to default Highlight the new script you just created Click Run Click Yes 4. Install WinSCP Download and install WinSCP on Windows machine https://winscp.net/eng/download.php Allow WinSCP to start when done 5. Configure WinSCP to auto logon Create a new session/site: Change Login window using the following File protocol: SCP Host name: enter the NAS host name or IP address Port number: enter the port number you used from step 3 Enter User name: "admin" and password 6. Add switching to super user Click the Advanced... button In the the Advanced Site Settings window do the following: Select SCP/Shell under Environment Shell box: "sudo -i" Click OK to return to the Login window Click Save Click "Login" 7. Create a workspace and shortcut for WinSCP (this step is optional) This will create a Windows shortcut to start WinSCP and automatically login to your session without any prompts Log into your new session you created in Step 5 Click Sessions Click Save Workspace... type a name for your new workspace Click OK Create a Windows shortcut to the WinSCP workspace you just created Example of Windows shortcut to workspace named Media-Server "C:\Program Files (x86)\WinSCP\WinSCP.exe" "Media-Server" /Desktop Click shortcut to start WinSCP and be logged into your NAS as Superuser without any prompts
FrostByte posted a topic in SynologyPosting this for people who like myself are new to Unix/Synology and want to use WinSCP with write/delete capabilities to have more control when managing their Emby server from a Windows machine. Warning!! Once you've done this you will have administrator access using WinSCP all the way to the root folder of your NAS and you can really mess things up if you're not sure what your're doing. 1. Reset superuser privileges on NAS. This will also stop the sudo command from prompting administrators for a password in order to work with WinSCP. Open DSM Control Panel Click Task Scheduler Create a task General tab: (Uncheck "Enabled") Task Settings tab: text version of "Run command" field (copy/paste the information below to be safe): cat <<EOF > /etc/sudoers Defaults syslog=authpriv root ALL=(ALL) ALL %administrators ALL=NOPASSWD: ALL EOF chmod ug=r,o= /etc/sudoers (Click "OK") Then run the new task you just created*: (Click "Yes") * You may need to run the task again after every DSM update as Synology tends to reset these privileges themselves --- 2. Enable SSH on NAS Open DSM Control Panel Click Terminal & SNMP Terminal tab: (Check "Enable SSH service" and then click "Apply") --- 3. Setup WinSCP Download and install WinSCP on Windows machine https://winscp.net/eng/download.php Allow WinSCP to start Login box: File protocol: SCP Host name: enter the NAS host name or IP address Port number: enter the port number from step 2 User name: "admin" Click "Login" Password: use your admin password