Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using Linux Suse 10 and I am a complete noob when it comes to using it that's why I really needed some help.
The scenario is simple. I need to transfer some files from my linux server to a windows pc.
I already did this using FTP commands written inside a .scr file. Here's the content of my Upload.scr :
ftp -n 10.*.*.* <<SCRIPT
user administrator drowssap
cd TESTDIR
binary
lcd /path/of/the/txt/file/
put TESTUpload.txt
bye
SCRIPT
And then I would call it from linux Konsole using :
bash Upload.scr
It was actually working and could successfully transfer files to my windows pc. However, what I need is to transfer the files using "psftp".
The original code which works from windows-to-windows transfer is :
ProcessStartInfo PSI = new ProcessStartInfo("CMD.exe", "/C psftp " + UserName + "#" + IP + " -pw " + Password + " -b UpLoad.scr");
I needed to do the same to my linux-to-windows transfer (i.e. I needed to use psftp instead of just ftp or sftp).
Whenever I tried to type "psftp" on linux Konsole it would display the ff :
bash: psftp: command not found
I know there's something missing. What should I do first to make it work? Should I install some application or .exe file into my linux server?
I really need help.
Thank you very much in advance! :)
psftp is PuTTY's SFTP utility.
OpenSSH has one too, named simply sftp (without the p). It is very likely already installed on your Linux machine.
If you want to install PuTTY's psftp, you just need to run:
apt-get install putty-tools
or equivalent for your distribution.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 10 months ago.
Improve this question
I have an question about the .exe log. I am using raspberry pi 4 module with Debian OS where I am running my c-program from the .service base auto-start .exe process. Which is running well So whenever raspberry Pi will restart my program will start automatic.That's fine but how do I see my print-f log from the terminal.
When I run exe with below line it will print the message but when this .exe running through the auto-services how can we check the log ?
Is there any linux command which will help to print run-time message. ?
root#raspberrypi: $./test.exe
it seems that you are using a systemd service unit, to run your binary.
if so, you can use:
journalctl -u <name>.service
(replace <name> with the actual name of your service)
sidenote:
do not use the .exe extension for your elf-binaries ("linux binaries").
.exe is an extension for PE32 files ("windows executables"), but Linux is perfectly capable of running a file with an arbitrary name (extensions have no meaning under linux).
so: executables typically have no extension at all, and you should get used to that: use test instead.
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 using Ubuntu 18.04 as Windows Subsystem for Linux on my Windows 10 machine.
I've installed gedit without any errors or warnings.
But whenever I try to use the command gedit something (here something is a filename)
I get this error:
Unable to init server: Could not connect: Connection refused
(gedit:48): Gtk-WARNING **: 21:03:26.729: cannot open display:
You need an X server to run graphical applications like gedit.
I use VcXsrv or Xming on my Windows desktops, both are very small and easy to install,
but there exist other servers like Cygwin/X.
Short instructions for VcXsrv/Xming:
download and install the Windows package
start XLaunch or Xming
export the DISPLAY variable in your WSL terminal and start gedit
export DISPLAY=0:0
gedit
I have the problem that some checkboxes in gedit's preferences are not working (dconf error, I don't care), but other than that the editor is usable.
Related:
What's the easiest way to run GUI apps on Windows Subsystem for Linux as of 2018? (askubuntu.com)
To fix this problem
Step 1- Download and Install this Windows X Server https://sourceforge.net/projects/vcxsrv/
Step 2- Open XLaunch
Step 3- Select " Full screen " option
Step 4- Choose " Start no client " option
Step 5- Simply do next and finish
Step 6- Open terminal and type :
export DISPLAY=0:0
gedit filename
In case your Linux machine is available with host name = 'hostname' and you'd want to ssh into the hostname and then open gedit then execute the following commands:
Enable X11Forwarding in the ssh server
[hostname] $ vim /etc/ssh/sshd_config
# and set X11Forwarding to yes
X11Forwarding yes
Set the DISPLAY env in the client terminal and then ssl with -X flag
export DISPLAY=0:0
ssh -X yourusername#hostname
[hostname] $ gedit filename
It's probably because you are running it with root user.
Run it as non-root user.
(If you don't know that if you are running it as root or not, enter the command below and if it returns 0, it means you are root and you must to login to non-root user: id -u)
(If you had run sudo su or something like that, It means you are root and you must use exit to go back!)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I'm trying to execute a bash script using ssh.
Say there is machine A and B. The bash script is on A and it has a command using a package installed locally in A. The package is not installed in B. I am trying to run the script from A when sshing to B. But I am constantly getting 'command not found'.
This is what I did:
ssh username#server 'bash -s' < local/path/to/file
I am wondering that is it because I don't have the package installed on B, the server? Is there any way that I can execute the script using B without having to install the package on it (my account do not have the write access to the directory)?
Theoretically you could, with lots of effort, embed the entire software in question in your script and pass that on the SSH standard input. But in the case of a properly secured server (which could even be a different platform) and a compiled program with lots of dependencies this could be anything from tricky to a multi-year project.
The trivial case of the "package" being just a single-line shell script without dependencies you could simply copy the contents of the script into your script. But the vast majority of cases are going to be orders of magnitude more difficult.
The commands passed to ssh inside the single quotes are executed on the remote host; therefore, those commands must exist on the remote host in order for them to execute there.
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'm a user of Ubuntu 12.04 LTS and in a future a user of Ubuntu 14.04 LTS.
I have a problem, when I run Ubuntu my .bashrc script doesn't work unless I open the terminal.
This is a problem because, for example, the paths I write doesn't work unless I execute the programs from the terminal.
Are there an user config startup file for Ubuntu and not for the terminal?
P.D.:Maybe I don't explain very well, in other words, I'd like to execute mi scripts on Ubuntu startup without using the terminal.
Shell initialisation files (.profile, .bashrc, etc.) are intended for preparing the user's (interactive) environment.
For standalone scripts, it's better to make them independent from the environment, including
$HOME, $PATH, etc.
If you need to share code (functions, configuration) with other scripts, store that in a separate
shell library that you source from a known location, either through a fixed path or from a
path relative to the script's own location.
you can add the line below at the start of your script file
source ~/.bashrc
grep '/etc/bashrc' ~/.bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc # --> Read /etc/bashrc, if present.
by default /etc/bashrc gets loaded when opening a console.
What are you trying to do - if you want to do something without it being executed as part of a console and more to do with system startup ? then you need to look into modifying existing service or adding a new service.
If this is related to when users ssh or connect it via console then its be bashrc file
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am using putty for copying files from local machine to remote server.My folder is in C:/site
can any one give syntax for copying folder from C:/site to remote server using scp
scp -r C:/site user#server_ip:path
path is the place, where site will be copied into the remote server
EDIT: As I said in my comment, try pscp, as you want to use scp using PuTTY.
The other option is WinSCP
In stall PuTTY in our system and set the environment variable PATH Pointing to putty path.
open the command prompt and move to putty folder. Using PSCP command
Please check this