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 9 years ago.
Improve this question
I have a Raspberry pi that I have been accessing through SSH, but now I need to run a python program on it that has a GUI. I'm not sure how to do this through SSH. Usually I get to my raspi's desktop gui by typing startx. Is there anything I can do like this over ssh?
Thanks!
The approach mentioned by kjprice just displays the applications you started on the remote host. If you want to see a complete dektop, you could either create a new Xserver or use Xephyr to nest a Xserver in the one you are currently using.
Well first create a new nested Xserver:
user#host $ Xephyr :1 -screen 800x600 &
A window called "Xephyr on :1" should spawn. Ssh into the remote host an forward the display to the created display:
user#host $ DISPLAY=:1 ssh -Y username#remotehost
Now start a session on the remotehost, in my case LXDE:
user#remotehost $ lxsession
You should now see the desktop in Xephyr. hf
You can do X11 forwarding with ssh. If you start an ssh session with -Y or -X it'll enable X11 forwarding. So, any program you run in that session that creates a window, the window will be drawn locally. You can also pass ssh a command to run :
$ ssh -Y user#$some_ip /path/to/some/remote/python_script.py
If you want a full gui session, then you'll want to setup an RDP or VNC server on the rasp pi and connect to it with some client.
Related
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
Stuck on error while starting a ssh server
I already installed openssh-server and openssh-client
Here is the image of error
The normal option to use when starting sshd would be:
-D to test it (preventing it to detach its process and force it to run in foreground: try the ssh in a separate Windows)
-h host_key_file if you are running it as a non-root user
-p port, again if you are launching the daemon as a non-root user (and cannot use privileged ports
If you can, in your WSL2 session, try
sudo sshd
That will run it as root, in the background
Then try your ssh command, making sure you have copied ~/.ssh/id_rsa.pub first in ~zeus/.ssh/authorized_keys.
If that does not work, kill then run again sshd, this time with:
sudo sshd -d
That will launch it in foreground, and you will be able to see if your ssh command at least is received by the SSH server, and if there are any error messages.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Which is best to use for running chef-client remotely? The provided knife ssh command or regular ssh to machine and execute chef-client manually by switching to root. I understand knife ssh talks directly to chef and should be used but is it only recommended to use knife ssh over regular ssh? Are there any drawbacks of using ssh over knife ssh?
What's "best" is subjective and depends on your requirements. Hope you have looked at the knife ssh documentation.
In my opinion, knife ssh is good for running commands remotely especially on multiple nodes at the same time. One of the strong points of knife ssh is that you can target your nodes with a SEARCH_QUERY. This allows you to run command on all nodes, single node, or anything in between.
Example: run chef-client on single node dc-web-srv01.exampleco.net:
knife ssh 'name:dc-web-srv01.exampleco.net' 'sudo chef-client'
Example: run chef-client on all web servers matching dc-web-*:
knife ssh 'name:dc-web-*' 'sudo chef-client'
Or if you associate roles with a group of servers like db-servers:
knife ssh "role:db-servers" "sudo chef-client"
You can run any other command as well, if you want to see the date on all servers:
knife ssh "name:*" "date"
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 4 years ago.
Improve this question
I just upgraded the ssd card to 2018-11-13-raspbian-stretch-lite. Hence, no screen, no keyboard, just headless. With the version before I used SSH to acess the raspberrypi 3. But now i have trouble. SSH is disabled by default. Could be overcome by writing an empty file named ssh into / . Fine, should be easy, but it isn't. I tried to mount the ssd-card in a card reader from a linux computer. This would allow to write the required empty file with cat /dev/null > /mnt/rasp/ssh , but it doesn't work, because the device is mounted read only indepent of how I try to mount for read-write!
Has anybody an Idea how to open the ssh, maybe over USB-Telnet, or what ever?
You have to create a file called ssh in the boot partition, not the root partition.
You can also create a file called wpa_supplicant in the same place and your RasPi will join your wifi network.
You'll probably be able to ssh into it with:
ssh pi#raspberrypi.local
If not, look in your router's "DHCP clients" table or use nmap to get its IP address. Or install the fing app in your smartphone and it'll tell you the IP addresses and host/OS of all your network clients.
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 want to see if port 1878 is open on my Windows Server 2008 R2.
I use VPS server, so i talked with the VPS servers company and asked them to open all ports.
When i'm running telnet 172.0.0.1 1878 i get that the port is not reachable.
Is there another way to see if the port is open or open it?
Use may use software such as nMap to test if a port is working, more specifically if it is closed or open.
You may have to add the -Pn tag incase the port is hidden.
http://nmap.org/
Use the CLI Command:nmap (IP) -p (port)
Or, you may use a web based tool to check it if your VPS is live.
http://www.yougetsignal.com/tools/open-ports/
You can use netstat to list out what is used and what isn't. You could also download netcat for windows, which effectively does the same as you trying telnet, it just has a command line option just to test if it can connect. That would be something like:
nc -z 127.0.0.1 1878
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 PuTTY to connect my Windows machine with remote machine and I am able to connect to remote machine but when I am using SCP command to download some files to my local Windows machine it is saying:
ssh: connect to host XXXXXXXXXX port 22: Connection refused
lost connection
I am writing this command:
scp * username#mywindowsmachine:~/Desktop
Use winscp to do this :
http://winscp.net/eng/docs/introduction
WinSCP will enable you to exchange files with the server while ssh is used to issue shell commands on this server (and is powerless in your case as your local windows machine can't probably answer to its ssh connections).
You would use scp if you were on a shell but as you're on windows (and probably don't use things like cygwin), you'll find winscp to be the easiest solution.
if you manage the server you are trying to connect to, start the SSHD with debugging enabled you will see exactly why it is refusing the connection
IF sudo chown -R www-data:webmasters/dir/dir/dotfile - possibly need to give permissions to your bash "user" instead via ssh.