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

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.

Related

Recently installed Linux Bash Shell (Ubuntu installed) not showing my files on my windows computer [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 8 months ago.
Improve this question
I've ran into a problem when trying to use an installed Linux bash shell instead of my Windows command prompt. I can't get my computer files to show on my Ubuntu terminal, even though when I repeat the same actions on my windows command prompt they seem to work.
I'm thinking there must be an issue with my installation, possibly I need to do a few more steps to get it to work like my regular command prompt terminal, but I'm not sure how to do this currently. I've added some screenshots above for additional context of me not finding my files in Ubuntu but being able to find them through windows command prompt.
It's because your linux home directory is most likely located outside of your windows user's home directory.
Use windows search to look for one of your ubuntu files (for example git_101) to determine where is your ubuntu home directory in relation to windows file system.
This can vary depending on how you installed ubuntu, but you might be able to access your windows filesystem via the /mnt directory as well. You can check that by running ls -lah /mnt.

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.

Is there any way to copy file present at my local machine to remote Linux only by command line? [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 9 years ago.
Improve this question
I want to copy a file present on my local directory i.e. C:\Users\karansha\Desktop\Backup\sj1slm612\express_13000\config.xml
to remote linux machine directory : /apps/configuration/
I tried command using putty but it says No such file or directory :
scp C:\Users\karansha\Desktop\Backup\sj1slm612\express_13000\standalone-full.xml /apps/instances/express_13000/configuration/
scp requires a remote host name to copy to (or from). In your sample command, you didn't specify which host you're copying to, so it assumed you're doing a local copy.
sorry, misread the question.
add "username:password#hostname:" to your command file.
scp C:\Users\karansha\Desktop\Backup\sj1slm612\express_13000\standalone-full.xml username:password#hostname:/apps/instances/express_13000/configuration/
for example:
scp C:\Users\karansha\Desktop\Backup\sj1slm612\express_13000\standalone-full.xml karansha:karanshaspassword#karansha.com:/apps/instances/express_13000/configuration/
In order for scp to understand that you want to access a remote machine, you need to specify the address for that machine.
Your current command will copy the xml file to another local file called "/apps/instances/express_13000/configuration/", if it even works at all.
scp C:\Users\karansha\Desktop\Backup\sj1slm612\express_13000\standalone-full.xml /apps/instances/express_13000/configuration/
Instead try something like this:
scp C:\Users\karansha\Desktop\Backup\sj1slm612\express_13000\standalone-full.xml username#10.0.1.2:/apps/instances/express_13000/configuration/
Of course, replace "username" with the username for that machine, and "10.0.1.2" with the actual machine IP address.

How to install a program in linux for all users not only for root? [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 8 years ago.
Improve this question
I installed the shrewsoft vpnmanger on my linux (crunchbang kernel 3.2.0-4 amd64) the problem is, that somehow it can only be started as sudo. Can someone explain how i can fix this?
sudo /usr/local/sbin/iked&
How can I change the iked installation so that it is available for each user?
Thanks
It's just about the paths a normal user's shell search for commands. But normally it makes sense that those commands located in a sbin dir are not accessible by typing just the command's name. Those commands need access to protected resources that are only accessible by root.
But if you have the luck that you can gain the full rights by means of sudo you can simply create an alias via
alias iked="sudo /usr/local/sbin/iked"
and add it into your shell's resource file.
To make the full command accessible to all users by simply typing iked you can create a little bash script named iked with content
#!/bin/bash
sudo /usr/local/sbin/iked
and place it in /usr/local/bin.
Of course that implies an appropriate /etc/sudoers file and that the execute permission of iked is set.
try copying or symlinking in it in /usr/bin.
and see if it work for the user then, if it has a global log file (I don't know about this app so not one to comment) but assuming it has some log in /var/log/iked.log and its been written by root you will have permssion issues by another user, so chown it to some neutral group like users or something.:
Try here it may give you more info, I can see you could try:
/usr/bin/iked -d 4
But from what I read it does have a log in /var/log and yep that permission issue would be the primary issue specially if root was the first user to run this app.

Resources