Winscp не сохраняет файлы
Для удобства работы с удаленными Linux серверами и обычными машинами многие начинающие пользователи использую программу WinSCP. Она и вправду очень удобная и простая в использование в отличии например от PuTTY, напоминает обычный проводник Windows. Но важно понимать что WinSCP это клиент который предназначен для копирования файлов, конечно с его помощью можно настраивать config и изменять другие файлы. Но выполнить какую либо команду не получиться, например, запустить службу или установить её. Для этих целей придется обратиться к PuTTY. Сегодня рассмотрим ошибку «Доступ запрещен, код ошибки 3» которая может появиться во время каких либо действий с файлами, копирования, перемещения, изменения и т.д. Говорит это о том что у Вас не хватает прав, но давайте обо всем по порядку.
Possible solution, Notepad++ Multi-Instance Mode
May have found a solution. So far successfully editted 10-out of-10 with by changing Notepad++ to multi-instance mode.
Within Notepad++:
Settings > Preferences > Multi-Instance > Always in Multi-instance Mode
Note: You MUST restart Notepad++ for this setting to take affect.
@JamJam11355: Confirmed resolution, Notepad++ in Multi-Instance mode does not experience this problem. Using Notepad++ in Single Instance mode causes the issue intermittently with single file edits, and 100% of the time if attempting to edit multiple files simultaneously via WinSCP.
The next version of WinSCP will automatically restore the editor options defaults when changing editor command from Notepad to 3rd party editor
Bug 1872 – Automatically restore external editor defaults when changing editor command from Notepad to 3rd party editor
1. Установка WinSCP
- Данная программа не требует установки, просто скопируйте исполняемый файл в любую удобную для вас папку.
Read-Only Configuration
Particularly, when using a shared INI file or when pre-configuring WinSCP for a specific task, you may want to set the configuration or its parts read-only.
Соединение с серверами
Registry Key
If you use registry as configuration storage, the configuration is stored under the following key:
Интерфейс
Программа предлагает два пользовательских интерфейса, каждый из которых может быть настроен при помощи множества параметров.
Вы можете выбрать для себя интерфейс при установке. Позднее Вы также можете в любой момент выбрать используемый интерфейс.
Если Вы только начинаете использовать WinSCP, возможно Вы предпочтёте использовать интерфейс в стиле Проводника Windows Explorer, так как он хорошо известен всем пользователям ОС Windows. Однако, если Вы привыкли работать в программах типа Norton Commander, таких как целый ряд современных файловых менеджеров (Total Commander, FAR, Altap Salamander), выбирайте соответствующий интерфейс. Интерфейс как в Norton Commander более удобен для управления с клавиатуры, им можно пользоваться вообще без помощи мышки. Он также позволяет выполнять основные операции быстрее и более нагляднo.
WinSCP can store its configuration both to Windows registry and INI file. When installed, the configuration is stored by default into the registry. Portable versions use by default an INI file (if possible). To switch the storage see Storage page of Preferences window.
Note that configuration of restrictions and enforcements by administrator, is always stored in Windows registry.
Read-Only Configuration Sections
You can set individual configuration sections read-only. This way you can for example prevent a user from changing default transfer settings, while still allowing other kinds of customizations.
Setting a configuration section read-only makes WinSCP silently discard any changes to that section, when saving the configuration.
An access to individual sections is controlled using an optional Access key. If the key is not set, a section inherits the state of its parent section. By default, all sections are writable. To set a section read-only, set its Access key to readonly . To enable writing to a subsection of a read-only section, set the subsection Access key to full .
To change the default state of whole configuration, set root Access key. In Windows registry, it is a key in WinSCP root registry key. As INI files have no root section, WinSCP looks into a special section named [_] (a single underscore).
For example the following INI file sets all configuration read-only, with an exception of a host key cache and interface settings (but in turn with an exception of transfer settings, which are again read-only):
Temp file missing
I have never had to look for this configuration since I used WinSCP and Notepad++. I did uncheck it, and seems to work with connection servers connected to LAN (plus the refresh set to 30sec under panel/remote). But with WinSCP connected to AWS, the same issue: 'keep non-existent file' dialog pops up everytime I switch to another window and back, seems the temp file gets deleted for Notepad++ to not find it, thus the pop-up.
Importing/Restoring Configuration
To import/restore the configuration, go to Tools > Import/Restore configuration on Login dialog.
File are not saving after I edit in notepad
Any file I select in WinSCP and open it in external editor Notepad++ after editing, I'm saving it by ( CTRL+S ) the file which I edited is not reflecting in WinSCP.
WinSCP - это графический клиент SFTP (SSH File Transfer Protocol) для Windows с открытым исходным кодом. Он также поддерживает [устаревший] протокол SCP (Secure Copy Protocol). Предназначен для защищённого копирования файлов между компьютером и серверами, поддерживающими эти протоколы.
Перед Вами - краткое введение в WinSCP для русскоязычных пользователей. Значительная часть документации по WinSCP существует только на английском языке, и большинство ссылок отсюда ведут туда.
2. Подключение к серверу
-
В окне WinSCP выберите сессию Tornado и нажмите «Login ».
Read-Only INI File
A simpler way to make whole configuration read-only is to use an INI file and set it read-only in a file system.
When INI file directory or the file itself is not writable (for example when the INI file is in Program Files folder or when it is explicitly set read-only), WinSCP does not preserve its state when exiting. No error message is displayed. Only when you explicitly change configuration (such as when you save site, or submit Preferences dialog), an error is shown. You can make WinSCP overwrite a read-only INI file by holding Shift key, while closing or submitting Preferences dialog.
Exporting/Backing up the Configuration
To export/back up your configuration, go to Tools > Export/Backup configuration on Login dialog.
In older versions of WinSCP, use Export button on Preferences dialog.
Возможности программ
Temp file missing
Found the solution to the missing temp file (will update here if something isn't right).
Storage/Temporary Directory set to use user's temp location c:\users\yourusername\AppData\Local\Temp in 'Use this directory' instead of the 'Use temporary directory of system' .
This can be setup during the installation(?)
Thanks for sharing your solution. What folder does WinSCP use, if you use the default Use temporary directory of system ?
Загрузка и установка WinSCP
Программа WinSCP продолжает разрабатываться и совершенствоваться. Свежую англоязычную версию программы можно скачать на странице загрузки WinSCP.
Для установки русской версии выберите пункт “Multilanguage installation package”, а в начале установки выберите “Russian” в списке языков.
Если на момент загрузки русский перевод последней версии WinSCP не будет закончен, он не будет включён в полный пакет. В этом случае его можно скачать дополнительно. Для этого (после установки английской версии) зайдите на страницу переводов и скачайте перевод “Russian” и распакуйте полученный архив в ту же папку, куда установлен WinSCP. Подробнее это описано в руководстве.
Transferring the Configuration
To transfer your configuration to another computer/location, export the configuration to an INI file and then import the file on the another computer/location.
If you want to transfer just one specific stored site, you can generate a session URL from the site on the source location, transfer the URL to the target location, paste it to the Login dialog and save it. Make sure you include Advanced settings to the URL.
Auto-selecting Storage
On startup, WinSCP first looks for an INI file in the directory, where WinSCP executable is stored in;1 and then in the user profile directory. If it does not find INI file in either location, it looks for presence of its key in registry, both in HKCU and HKLM . The HKLM key is created by the installer, so installed WinSCP uses the registry by default. If it does not find the registry key either, it creates an empty INI file in the directory, where WinSCP executable is stored in. If that directory is not writable, it creates an empty INI file in the user profile directory.
Checking What Store Is in Use
When troubleshooting problems, it is necessary to find whether WinSCP is actually using the configuration storage you intended. For that inspect a beginning of the session log:
Tag Configuration shows either HKCU Windows registry key or a path to an INI file. When Windows registry configuration storage is in use, it is also important under what Windows account is WinSCP running, to know what account the HKCU refers to. For that refer to Local account tag.
WinSCP — свободно распространяемая программа для Windows для защищенного копирования файлов между компьютером и сервером, поддерживающим протоколы SFTP, SCP, SSH-1, SSH-2.
Sharing the Configuration between Machines
Issue persists, Affects WinSCP 5.11.3 thru 5.13.3 at least
I am having the same issue.
In Windows Explorer I can visually observe the local temp directory and file being created by WinSCP, then immediately deleted after it opens in Notepad++.
Using Notepad++ v6.6.6 32bit,
Have tried downgrading WinSCP from 5.13.3 to 5.11.3 – No change,
Tried every option in WinSCP Options -> Storage , problem persists with every setting:
--> System temp directory : same problem
--> Use This Directory : same problem
--> With or without "Append Session Name. "
--> With or without "Append remote path to temp path"
--> With or without "Keep temp copies.. in deterministic paths"
--> With or without "Clean obsolete temp directories"
At this point my best guess is Notepad++ is not sending whatever file in use signal WinSCP needs to detect the file is still being edited. I say this because the deletion behavior is identical to having WinSCP edit a document in Notepad.exe but then closing the Notepad window; (when Notepad is closed, WinSCP deletes the temporary file and directory).
Removing Configuration
You can clean up all configuration data stored on your machine.
64 bit winscp integration
Using a 64-bit version, moving back and forth from Notepad and WinSCP, the temp file goes missing. Moved to 32-bit and the issue disappeared.
@kalabog76: Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.
Файловые операции
WinSCP выполняет все основные операции с файлами, такие как загрузка и выгрузка файлов. Он также позволяет переименовывать файлы и папки, создавать папки, изменять свойства файлов и папок, а также создавать символические ссылки и ярлыки.
Один из двух интерфейсов программы позволяет также управлять файлами на локальном компьютере пользователя.
No Configuration
INI File Location
When loading configuration, WinSCP first looks for an INI file in the directory, where WinSCP executable is stored in. The INI file needs to have an .ini extension and the same name as the executable (i.e. WinSCP.ini ). If INI file in not found there, WinSCP looks to application data directory of your user profile, i.e. to C:\Users\username\AppData\Roaming\WinSCP.ini .
When you opt to use INI file for the first time, WinSCP tries to write it to directory, where WinSCP executable is stored in. If the directory is not writable, INI file is stored to application data directory of your user profile.
You may also use an INI file in a different folder or with a different name using /ini switch or in preferences.
Что делать если во время работы с файлом появляется ошибка «Не могу заново открыть файл ‘/»
И так Вы работаете с фалами на удаленном сервере через клиента WinSCP, Вам потребовалось скажем скачать (переместить, изменить, переименовать и т.д.) это файл к себе на компьютер.
Все это говорит о том что у Вас просто напросто не прав на изменение этого файла. Определить это можно если посмотреть на колонку «Права», в данном случае видим что чтение и запись разрешены только владельцу файла «root». Для работы с файлами под обычным пользователям права должны выглядеть в этой колонке как и папки выше.
Можно определенному пользователю дать права «root» изменив настройки sftp сервера. Данный способ описан практически в каждой статье которую вы найдете в поиске. Но в этом случае обычный пользователь сможет удалять изменять системный файлы и файлы конфигурации. В результате можно положить сервер.
В нашем же случае гораздо проще изменить права необходимого файла. Для этого придется воспользоваться программой PuTTY.
Скачиваем и запускаем программу, для подключения вводим ip адрес удаленного сервера.
В открывшемся окне сначала авторизуемся под обычным пользователем, потом с помощью команды «su» получаем «root» права, и запускаем файловый менеджер «mc».
Находим необходимый файл, выделяем его и на панели инструментов открываем раздел «Файл» и выбираем пункт «Права доступа».
В открывшемся окне отмечаем пункты, если есть группы отмечаем «Чтение для групп»,» Запись для групп», если групп нет тогда «Чтение для других» и «Запись для других» либо можете отметить и то и то.
После этого необходимо переподключиться к удаленной машине в клиенте WinSCP.
После этого все возможные действия (копирование, перемещение, изменение и т.д.) с фалом должны быть доступны.
When I set Notepad++ as a default editor for WinSCP and open one remote file at a time, it works just fine.
When I open multiple remote files and try to save any other than the first one, I get a message:
The file cannot be saved and it may be protected. Do you want to launch Notepad++ in Administrator mode?
This combination used to work just fine in my previous pc about one year ago.
Now I’m using WinSCP’s internal editor and it works fine but I’d prefer using Notepad++.
Is this more like Notepad++ problem than WinSCP problem? Any ideas how to fix it?
The problem seems to appear only with 64-bit version of Notepad++. I changed to 32-bit version and it works fine.
martin◆
Site Admin Joined: 2002-12-10 Posts: 37,167 Location: Prague, Czechia
In WinSCP settings, go to "Storage" and check "Keep temporary copies of remote files in deterministic paths" . It worked for me.
3. Копирование/перемещение файлов
- После того, как вы удачно подключитесь к суперкомпьютеру, вы увидите следующее окно:
- В правой части окна, где отображаются файлы и папки сервера, перейдите в папку, в которую вы хотите скопировать/переместить файлы с локального компьютера. Перемещение по папкам происходит так же как в проводнике Windows.
- В левой части окна перейдите в папку, из которой вы хотите копировать файлы.
- Выделите файлы для копирования. Для этого либо выделяйте нужные файлы по очереди, щелкая по ним мышкой и удерживая клавишу Ctrl, либо выбирайте непрерывный диапазон файлов, щелкнув на первый, а потом, удерживая клавишу Shift, на последний файл из выбираемого диапазона.
- Скопируйте/переместите выделенные файлы из активной половины окна в другую, нажав кнопку «Copy »/»Move» внизу окна или F5/F6 на клавиатуре, а затем нажав «Copy »/»Move» еще раз в появившемся окне.
Примечание: копирование/перемещение файлов с сервера на локальный компьютер осуществляется аналогично.
Читайте также: