Error when performing rsh command - remote-debugging

I've tried executing a simple "ls" command on a remote server, using the command:
rsh -l limlim/myPassword myServerName "ls"
When running this command, I get the following error message:
rshd: luser too long
--> What am I doing wrong here?
My final goal is to use rsh to work on the server files, remotely, as I'm working on the files on my Eclipse, locally.
-->How can this be done?

Have you considered switching to the modern equivalent of rsh, ssh?
ssh is the standard tool for interacting securely with remote hosts, and you will find that there are more people with knowledge of ssh who are able to help you.

Related

PuTTY secure copy client | -bash: pscp: command not found |

I am trying to learn the Amazon's AWS - EC2 service and was following its tutorial (at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html)
I have successfully launched an instance and am on Step:2, Connect to your instance. I got PuTTY and followed the tutorial for connection using PuTTY (at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html)
Here I am unable to use the command - pscp -i C:\path\my-key-pair.ppk C:\path\Sample_file.txt ec2-user#public_dns:/home/ec2-user/Sample_file.txt as it shows the following error : ' -bash: pscp: command not found '
My main aim is to use an online free temporary server to host a RESTful API that I have made and tested on localhost in python3.
I am a beginner in this field and would like some help.
Thank you.
pscp is Windows program.
You are not supposed to use it in PuTTY terminal (on the virtual machine shell), but on your local Windows machine.

how to run python script located on a remote server

I have python script that I run on my cmd local machine.
now I want to run it also on a remote server(Windows)
How can I do it?
It is possible using ssh. Python accepts hyphen(-) as argument to execute the standard input,
cat hello.py | ssh user#192.168.1.101 python -
Run python --help for more info.
You can use the ssh approach, but also the PSEXEC approach which is easier to use, although you may need admin privileges on the server to execute processes and both windows machines better share the same user/password.
Download PsExec from here
https://technet.microsoft.com/en-us/sysinternals/bb896649
Run as follows:
psexec /ACCEPTEULA \\servermachine python fullpath_to\python_script.py
fullpath_to\python_script.py should be accessible from the server. If not, you have to copy it first here, or just put the script on a shared/networked drive visible by both machines.
Of course python must be installed on the server as well.
I'm not saying it is the best way. Jenkins is a good way to run stuff on a given server. But it does the job.

chef client run in aws bootup script not getting registered in chef server

We have used below command to run on booting aws machine. It ran chef client and software is installed. But i am not able to find server in chef console when i searched with vm ip address.
chef-client -r 'role[test]'
Can some one explain chef-client -r option works
The -r flag runs chef-client as normal but replaces the run-list coming from the Chef Server with the one specified on the command line. The two likely reasons for your confusion are either that chef-client is hitting an error which prevents the node data from being saved back to the server, or the way you are searching isn't correct. If you are looking for ipaddress:1.2.3.4, make sure you are using the private IP address (I think).

Running a process with nohup after SSH to a server using Python

I am trying to run a program as a background process in a server (AWS EC2 instance).
I have used boto.manage.cmdshell to obtain an ssh connection to the server.
However, I am having trouble running this command:
"nohup daemon-program param 2>&1 > ./logs/out.log &"
It runs fine if I manually ssh into the machine and run this command.
My console hangs after ssh-ing into the machine and running this command via python script.
If I remove nohup, the program starts and quits when the ssh session ends.
I would like it to run as a bg process even after I quit.
I tried reading about pty and nohup manual, but I seem to have missed something here.
Kindly point me to a (better?) instruction manual or explain why this fails while manual execution succeeds.
TIA!
If anyone is stuck, ran the command inside byobu and it worked.

Execute command or transfer files to remote windows machine

What I'm actually looking for is the equivalent off ssh connection in windows environment. As per requirement, my controller machine can connect to remote machine with username password using some kind of utility/protocol such as ssh or telnet or rpc or tpc and using this session I can transfer files or execute command on remote machine. This connection execution must be done without any intervention from remote machine, i.e. I don't need to install any module or install any utility on remote machine or run any script.
My both controller and remote environment are windows.
Can someone suggest me python module or utility, using which I'll be able do this ?
I explore few option however I'm not sure if they are the best way to do so. Pleas provide your thoughts on this too.
connect using psexec utility through popen.
using socket to communication channel, however I'm not sure if I can execute any command using this channel.
making use of Telnet. but I didn't explore the python module to make telnet connection and execute command.
using module such as Pyro or rpyc.
Any help is appreciated. Thanks a lot in advanced.
take a look at the pexpect module. It can be used for ftp, ssh ...
pexpect doc