Copy file from Windows to Linux via scp (from Linux) [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
I'm currently using scp to copy files between Linux systems.
scp username#hostname:/tmp/test.file .
Which copies my file from the remote server to the local machine.
What I would like to do is use the same scp command from my local Linux machine but copy a file from a Windows destination instead. How can this be accomplished?

You can use commands available with winscp to do this on the command line.
winscp command line
This syntax is pretty close to the Linux scp command - but with Window-ish flags.
You can find the winscp.exe executable at this path:
C:\Program Files (x86)\WinSCP\winscp.exe
EDIT 01:
And if you want to use scp on the Linux machine to copy from the Windows machine, you will need to run a ssh server on the Windows box.
FreeSSHd
OpenSSH
EDIT 02:
If you cannot install a ssh server on the Windows machine, you can mount an exported directory from Windows onto Linux using the samba fs mount.
samba fs mount

Finally found a solution
Downloaded pscp and used commandline option and then scheduled a job
c:\pscp.exe -q -batch -l mramkumar -pw xxxxx "c:\alm_testlink.png" mgr.sjc:/home/mramkumar
Created a as bat file and scheduled as a job,
This will keep pushing all the files in the folder to my linux server without prompting any password

Related

Why is node -v command not working with wsl2 Ubuntu 20.04 on windows [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 1 year ago.
Improve this question
I installed Ubuntu 20.04 on my windows 11 system but i can't run the "node -v" command like i used to with my powershell cmd.
It is saying command node not found, but I can run the same command on cmd and have the node version installed on my system display.
Please any solution
Some of the comments mention this briefly, but I think it warrants a more detailed explanation, with some additional information to help you on your WSL journey.
First, WSL does allow you to run Windows executables, but it requires the full executable name -- For instance, node.exe, assuming it is in your path. Otherwise, it would need /mnt/c/path/to/node.exe.
WSL also appends the Windows path to the Windows path, and translates it to the Linux form, so you'll automatically find things like:
/mnt/c/Windows
/mnt/c/Windows/System32
/mnt/c/Windows/System32/WindowsPowerShell/v1.0
...and others in when you echo $PATH under WSL/Linux. This means you can run PowerShell from within WSL/Linux as powershell.exe, and can even execute scripts and commands like powershell.exe -c "Get-Help" | less. Hey, finally - A decent pager under PowerShell! ;-)
That said, even if you can run the Windows node.exe under WSL, it's a bad idea to do so. The Windows version of Node understands Windows drives, Windows paths, and Windows network interfaces. When you are running in WSL, the shell will pass in the Linux path to a Windows command.
You can work around this with the wslpath command (installed by default in some WSL distributions), but really, as the comments pointed out, if you are running in WSL/Linux, you should install the Linux version of Node.
I recommend picking one or the other until you understand the differences, and unless you have a need for the Windows version, I'd recommend the Linux route.
This also means that you should keep your project files in WSL, probably in a directory under your Linux $HOME directory (i.e. /mnt/username). With WSL2, at least, this has two advantages:
Much faster performance (Visual Studio Code will even warn you of the performance penalty if you try to keep them on a Windows drive)
inotify support for projects where you enabled automatic watching/reload. This will not work with files on the Windows drive when working under WSL, but will work on the default WSL filesystem.

qemu-x86_64-static Exec format error after chroot [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 1 year ago.
Improve this question
I am on termux with root permission.
My phone has aarch64 cpu architecture.
I'm trying to chroot a ubuntu filesystem with amd64 architecture
i've seen and this https://unix.stackexchange.com/a/222981
here's my command
sudo chroot ubuntu /bin/qemu-x86_64-static /bin/bash --login
i logged in successfully but when i run command
ls or any
it's give an error like Exec format error
then i tried that command with qemu-x86_64-static like qemu-x86_64-static /bin/ls it's execute successfully
any idea for this???
i think i can add alias for all command for starts with qemu-x86_64-static but that's not good idea...
You need to tell the kernel that when it sees an arm64 binary it should run it by launching QEMU. The mechanism for this is called "binfmt-misc", and to configure it you need to write data in the correct format to special files in the host system's /proc/sys/fs/binfmt_misc/ directory. Most Linux distros will do this for you automatically when you install their QEMU packages, but obviously Android won't do this for you.
First check that your phone's kernel has binfmt-misc support compiled in at all: there should be a file /proc/sys/fs/binfmt_misc/status and if you cat its contents it should read enabled. If not, try modprobe binfmt_misc. If after that the status file is still not there then you won't be able to get this working unless you can somehow build a new kernel for your phone.
If the support is present in your phone's kernel, you can try the qemu-binfmt-conf.sh script that upstream QEMU ships as a mechanism for registering QEMU with the binfmt-misc machinery:
https://github.com/qemu/qemu/blob/master/scripts/qemu-binfmt-conf.sh
(This is just a script which writes the correct lines of data to /proc/sys/fs/binfmt_misc/register.)

Grub can't find grub.cfg file -- Stuck at GRUB 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 5 years ago.
Improve this question
I am using GPT/UEFI system. I installed KDE Neon and I was using it without any problem since the summer. Then today, I deleted /EFI/ubuntu/ and after I reboot the system, it stuck at grub command line "grub> ".
1- I can boot the system by writing following command to the grub command line
configfile (hd0,gpt1)/EFI/neon/grub.cfg
2- Also following command works
configfile (hd0,gpt2)/boot/grub/grub.cfg
3- Also following command works
set prefix=(hd0,gpt2)/boot/grub
set root=(hd0,gpt2)/boot
normal
4- I tried followings to fix by booting the system but non of them works
- boot-repair program
- update-grub
- apt install --reinstall grub-efi && update-grub
So this is the situation. How can I fix the problem ?
Thanks in advance.
I have just fixed the problem!
I boot the system manually by entering command to grub> command line. (one of the command that I mentioned in the question)
I opened a terminal.
cd /boot/efi/EFI
cp -r ./neon ./ubuntu
Reboot and it works fine.
I think the problem is specific for KDE Neon because it gave me exactly same problem when I installed it to a new computer. Grub is not looking inside the "/EFI/neon" directory. Instead, it is looking inside "/EFI/ubuntu" but cannot find it so it causes problem.
BTW, the reason I named new folder as "ubuntu" is that KDE Neon is Ubuntu based.

scp files from amazon linux machine to virtual box [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
I am trying copy a directory from my amazon Linux machine to my virtual-box. I write the following command from my amazon Linux machine:
scp /home/user/test xyz#xyz-VirtuaBox:/home/user
but I get the error message:
Could not resolve hostname xyz-virtualbox: Name or service not found.
I am not sure what's going on. My virtual machine hostname is right.
No! Your virtual machine hostname is not resolvable from amazon linux machine. You should do this the other way round. From virtual machine:
scp xyz#amazon:/home/user/test /home/user
Or the other way is to set up remote port forwarding, so you will be able to connect from your Amazon machine to your virtual box, but it depends if you use Putty or normal ssh. But the general command can look like this:
[local] $ ssh -R 2222:xyz-VirtuaBox:22 amazon
[amazon]$ scp -P 2222 /home/user/test xyz#localhost:/home/user
To make the copy, you need to have an open door to your virtual machine, then use the syntax
scp -pr -P <port> <directory> user#ip:<path_directory_destination>

Accidental change of ownership of some root directories in Ubuntu 14.04 [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
(Accidental) Action
Hi, I am not very well versed in Linux but using Ubuntu for more than a year.
Couple of days back I accidentally changed the ownership of my root folder while changing ownership of another non-root directory. I am not sure but as far as I remember, I executed sudo chown -R root:root /bin accidentally.
The Consequences
Now I am unable to do anything that requires sudo. This is the error I am getting while performing any such task:
max#max-ThinkPad-T430:~/Desktop$ sudo chown -R root:root /bin
sudo: /etc/sudoers is owned by uid 1000, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Question
What's the solution to bring back the sudo working exactly as it was before the incident.
I would recommend creating a bootable disk (CD, DVD or USB Drive) using the "Startup Disk Creator" (/usr/bin/usb-creator-gtk) and a recent Ubuntu Desktop .iso file, available from http://www.ubuntu.com/download/desktop/.
Once you have created the startup disk, reboot your computer and ensure that you boot from the startup disk. I assume you know how to do that given that you have installed Ubuntu before.
Don't choose the "Install Ubuntu" mode, just use the "Try It Out" mode to get to a desktop environment. From there you should be able to mount your existing Ubuntu setup and chown root /etc/sudoers so that your sudo command will work again.
Reboot to your real Ubuntu installation and try sudo ls, it should work now.

Resources