WinSCP: Permission denied. Error code: 3 Error message from server: Permission denied [closed] - permission-denied

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I am using WinSCP and keep on experiencing this error every time I try to replace/overwrite a file. I have been able to transfer/overwrite a file before with out any problem but not anymore.
The exact error message:
Cannot create remote file 'var/lib/tomcat6/webapps/..../myfilename.filepart'.
Permission denied.
Error code: 3
Error message from server: Permission denied
I have tried changing the ownership which I was successful at because when I refreshed, from tomcat6, it is now under my login name. But I am still denied. This is giving me a very hard time testing our reports as I just need to see if it's already working i n the deployed app.
I also tried tweaking some of the options in the WinSCP preferences such as Drag & Drop and Endurance but nothing made any difference.
I reinstalled PuTTY and WinSCP, but nothing changed.
I am able to replace my file by coming out 1 notch from the file path (ex. var/lib/myfolder/myproject/web-inf/report, back 1 notch to var/lib/myfolder/myproject/web-inf/)
then type
sudo chown myuser:myuser report -R
but my reports will have errors, so I had to type
sudo chown tomca6:tomcat6 report -R then the error will be cleared and I now can view my replaced file.
This is very inconvenient as I have to do this every time.
Is there anything I can do to fix this? thanks

You possibly do not have create permissions to the folder. So WinSCP fails to create a temporary file for the transfer.
You have two options:
Grant write permissions to the folder to the user or group you log in with (myuser), or change the ownership of the folder to the user, or
Disable a transfer to temporary file.
In Preferences, go to Transfer > Endurance page and in Enable transfer resume/transfer to temporary file name for select Disable:

Related

Run node.js script as admin / Access protected file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'd like to access a file that needs specific rights to open and write it. I tried:
to convert it into a .exe file: found no working program for that
run in elevated cmd: still no admin privileges
WSL - Sudo command: don't work
For any suggestions about how to open a protected file please help me. (I have full access to the computer)
Windows, right?
Grant access permission for the file to the Windows user under which your nodejs program runs.
Use an account with Administrator privilege.
Right-click on the file or, better, its containing folder in the file explorer.
Open the Properties box (bottom of the right-click popup).
Open the Security tab and click the Edit button.
Then, if the user you want is in the list, grant the extra privilege needed. If not, use the Add button.

How can I edit a file with copies in 2 different users in linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I use AWS vps server and apache2 is installed in it. I want to edit a file "index.html" from 2 different accounts (i.e. 1st user "ubuntu" and second user "www-data"). By now, I try to edit the file but I got permission error so first I change (chown) permission to "ubuntu " and edit file and again change (chown) permission back to "www-data" otherwise I will get permission error in web browser.
I used chmod 777 index.html but this didn't help.
Please help me finding some good solution. Because this is tough to edit. I do have sudo permission if needed.
Thanks in advance!
You have two options:
create a dedicated group and add the ubuntu and www-data users to this group. Then set with chgrp the group of the file and finally give the right permissions to the group with chmod.
If your server suports Access Control Lists (it should), you could use the setfacl command. You can read about the command here and here.

Issue with SSH Keys [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm having something very similar to: SSHD Gives error could not open Authorized Keys, although permissions seem correct
but not exactly the same thing.
When I try to connect to server with my user account I see the following error message in /var/log/secure
The error message says:
Could not open authorized keys '/home/<username>/$HOME/.ssh/authorized_keys': No such file or directory
which makes perfect sense, but when I go to the /etc/ssh/sshd_config folder to see where the sshd service should look for my authorized key folder it shows $HOME/.ssh/authorized_keys so i'm not sure why SSH is trying to append my /home/<username> to $HOME/.ssh/authorized_keys. I did double check and ran the following cmd: echo $HOME just to make sure $HOME wasn't set improperly. If anyone has any ideas it would be much appreciated.
sshd_config is not a shell script. $HOME/.ssh/authorized_keys is taken as a literal path, and since it does not start with /, it is appended to the user's home directory.
You should replace $HOME with the token that sshd interprets as the user's home directory, or simply use the relative path .ssh/authorized_keys (which, by the way, is the default).
AuthorizedKeysFile %h/.ssh/authorized_keys

How to grant permissions to VS Code to modify files in Windows Subsystem for Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I connected VS Code to WSL and when I try to save changes in my index.php file the following message shows up.
I tried to change the permissions on var/www/html using chmod but nothing changed.
So how to make VS code modify the file?
Even I faced the same issue on my linux system, following command solved it:
Go to that directory from terminal.
Write sudo chown -R <username>:<group> <directory_name>. This command will change ownership (both user and group) of all files and directories inside of directory and directory itself.
To know the username write whoami in terminal.
To know the group write groups in terminal (The first name in the list is your group name) for me both username and groupname was same.
Open VS Code with Root User permission.

SCP: file not found when trying to copy from windows to linux server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
In putty i want to copy a .war file from my machine (at D:\\file.war) to a remote server like this:
sudo scp -r D://file.war user#xxx.xxx.xxx.xxx:/tomcat8/webapps
it doesn`t work and i have also tried things like:
sudo scp -r \file.war user#xxx.xxx.xxx.xxx:/tomcat8/webapps
or
sudo scp -r /cygdrive/d/file.war user#xxx.xxx.xxx.xxx:/tomcat8/webapps
I have to type in my password two times then (one time for sudo, next time for user). But then i get always the same error:
<pathtolocalfile>: No such file or directory
Putty always connects via SSH. I need sudo to get permission to write into the webapps folder.
How do i have to specify the path? Sry, i´m trying this for the first time and after some research i´m getting more and more confused about how to do this the right way.
I managed to do what i wanted, although my solution is not the nicest:
I connected to the server using WinSCP and my normal user account.
There i copied the file into my user home directory.
Then i opened the Putty console in WinSCP and changed to root user with "sudo" (and typing in my password again).
Now i finally was able to copy the file from my user accounts home directory into the webapps folder of tomcat.

Resources