Enable SSH without screen Raspberry Pi - ssh

I try to enable SSH on my raspberryPi 4. I don't have screen and it's for that I created ssh file (without extansion) in D:boot. When I try to log in I get an 'Acces denied' response from ssh terminal. I try with pi id and raspberry password. I created/default new raspberry image (x64). when I take back my sd card to check, ssh file doesn't exist.
Have you any issue.

I was running into the same problem, but in this case its not a problem about SSH itself.
The real problem is RaspberryPiOS removed the default User "pi" since the lastest version (April 4th, 2022). Means you get "access denied" because there is no User named "pi". (Release notes here: https://downloads.raspberrypi.org/raspios_arm64/release_notes.txt)
To create a user you have 3 options: (use 1 out of 3)
Plug in a display and keyboard on your RasPi and follow the steps on screen to create a User.
Use the Raspberry Pi Imager tool to create a new Image on your SD-card. Under advanced settings you can set a username.
Flash the Image again and beside creating a "ssh"-file you need to create a "userconf.txt", containing a single line of text, consisting of "username:encrypted-password".
For example: (to get standard-user "pi" and password "raspberry" again.)
"pi:$6$/4.VdYgDm7RJ0qM1$FwXCeQgDKkqrOU3RIRuDSKpauAbBvP11msq9X58c8Que2l1Dwq3vdJMgiZlQSbEXGaY5esVHGBNbCxKLVNqZW1"
More information here: https://discourse.pi-hole.net/t/warning-latest-raspberry-pi-os-image-april-4th-2022/54778
Hope i could help, have a great day!
WhisperFromDarkness

What is so maddening about this is that the latest Imager (at least the macOS version) pre-populates the user name in the advanced screen with "pi", which is no longer a valid user. After about 3 attempts, it dawned on me that I had to put in a different username and password to get SSH to work. They should definitely update the Imager with a blank username.

Did you manage to solve this yet? You can solve this using the Raspberry Pi Imager application.
To begin, when referring to the fact you have no screen, I assume you mean you are running the raspberry pi 'headless', meaning controlling it through secure shell (SSH) over your local network.
If you have not already installed the raspberry pi imager application, this can be found on the official raspberry pi website. On this application, you must select the relevant SD Card and operating system, before pressing CTRL+SHIFT+X, which will take you to the advanced settings page. Here, select 'enable SSH', before entering your WIFI SSID and password.
Once you have completed these steps and re-entered the SD card into the raspberry pi, you may open the terminal and enter 'SSH pi#ipaddress', followed by the password you created during setup, or the default password, which I believe is simply 'pi'. You will now have access to the Pi through SSH. Enter the command
sudo raspi-config
and you may alter the configuration settings as you like. Here, you may wish to change the VNC settings, so that you can view your raspberry pi GUI through remote desktop SSH.
I hope this was relevant and solved your query.

Related

Raspberry Pi / Remote Desktop, "connection problem, giving up"

I have three new Raspberry Pis running this OS:
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
I cannot get Remote Desktop to connect properly. I have xrdp and all updates installed on the Pi. SSH is on and I can connect via a gitbash terminal fine. VNC connection is enabled and viewer connects just fine. I keep getting the following error after logging in to the Pi's ip address (192.168.4.84):
Connecting to sesman IP 127.0.0.1 port 3350
sesman connect ok sending
login info to session manager, please wait...
login successful for display 10
started connecting
connection problem, giving up
some problem
Per many other posts, I have tried:
restarting the xrdp service
adding auto lo to /etc/network/interfaces
reinstalling xrdp, vnc4server, and tightvnc in various orders per this answer.
adding allowed_users = anybody to /etc/X11/Xwrapper.config per this answer.
per this post, I tried purging xrdp, then purge vnc server, then reinstalling xrdp with no luck.
I tried installing an older version of xrdp per this answer, but the package is no longer available.
I tried adding this to sesman.ini, no luck
I have another Raspberry Pi running version 10 OS with no issues:
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
Any suggestions to get the newer OS working properly?
I have found the reason for the issue in this answer.
Turns out you cannot login twice with the same account using xrdp on Raspbian Bullseye (Debian 11). So you need to either disable autologin using "Raspberry Pi Configuration"/sudo raspi-config or create another user.
I created a second user and confirmed that this works. Thanks #A.J.Bauer
I got my Pi 4 today and ran into exactly your problem. Took me 1 hour to figure out how to fix, hope it can help:
Remove and purge all VNC server and then install/reinstall XRDP
sudo raspi-config
Go to (1) System Options -> S5 Boot/Auto Login -> select "B3 Desktop GUI - requiring user to login". It should works with this option. Otherwise you can give a try with the automatically logging in as pi user option.
Reboot and have fun !
The problem is that there is some process
still using the login name.
I solved this way:
add a new user, give sudo privs
rdp with that, it should work
deluser the previous one
kill any process that gives error in point 3 and repeat
set autologin to console no auto w/ raspi-config
reboot
rdp with new user
adduser the old one
rdp with that
you're good to go

How to send a numeric value via ssh to the raspberry pi console

So I already have a SSH connection working but I'm looking for a command that can write a number like '1' into the console on the raspberry pi.
Thanks Sabifa
Have tried echoing it out to your terminal?
echo 1 > /dev/pts/0
Remember that (just about) everything has a device file, that can be redirected to. :)

New raspberry pi 2 B not able to boot into GUI

I just purchased new raspberry pi and tried to install raspbian using Noobs.
So the installation goes successfully and I boot into raspbian GUI successfully and make changes to raspi-config like to ask for the password when booting into GUI and enable various option like SSH,SCI and more. Then it reboots and gives me following error:
Raspberry pi Fatal server error: could not create lock file in /inp/.1xd-lock Please consult the X.org Foundation support at http://wiki.x.org for help
init: giving up
init: unable to connect to X server: Connection not sucessfull
init: server error nuth: error in locking authority file /home/pi/.xauthority
I have done this process so many time it is giving me same error every time. Any suggestion.......
Check your .xauthority file to make sure it's owned by the user you're logging in as rather than root. If it's owned by root, you can either change the ownership, or simply delete it and it will be recreated next time you attempt a login.
This has happened to me before!
It is likely your .xauthority file is corrupted, or root owns that file which means it won't let you boot into the GUI. Try this code and it seemed to work for me...
sudo chown -R pi:pi /home/pi
Basically what this is doing is it is reverting all the files' permission settings back to you, so the .Xauthority file for your account will be yours again.
BUT...
If the actual file itself is corrupt, then do this:
xauth -b
.Xauthority is not needed on startup, so it is safe to just delete it off your SD card, since a new version will be generated when you boot into the GUI.

xrdp_mm_process_login_response: login failed

HI I was trying to login remotely in the computer hosted by amazon services. It's ubuntu 64 bit machine.
In the beginning I was able to login into the computer with both client , remote desktop connection (RDP) keeping the default port (-1) and for the command line I am using putty session to access the computer. But after we made some changes and create new images of computer state. But When I try to login again it gives me the error xrdp_mm_process_login_response: login failed.
So I was wondering is that related with the port number ? or some image creation issue.
I will look forward to hear from you.
Thanks
Yash
I have run into the same issue. The solution to me is just to create new user for xrdp. While user "ubuntu" worked on original instance. After launching a new instance using a snapshot of the original instance, "ubuntu" login didn't work anymore. Then, after creating a new user, I could login with the new user onto xrdp.

Google compute engine ssh unavailable

I have restarted our google cloud compute engine instance, however after the restart ssh is no longer working and giving connection refused.
I have verified and the ssh keys are configured for the users, and firewall rules are open for ssh.
Is there any other method I can use to try and resolve this?
The first thing to do is to check the Serial console output of the machine to determine if the SSH daemon has started or not. That log can be accessed from the Developer Console.
If you couldn't ssh to the instance you can follow the below step to access the instance from the serial console:
Connect to the instance using the serial console
1. Go to the VM instances page in Google Cloud Platform console.
2. Click on the instance for which you want to add a startup script.
3. Click the Edit button at the top of the page.
4. Click on ‘Enable connecting to serial ports’
5. Under Custom metadata, click Add item.
6. Set 'Key' to 'startup-script' and set 'Value' to this script:
#! /bin/bash
useradd -G sudo USERNAME
echo 'USERNAME:PASSWORD' | chpasswd
7. Click Save and then click RESET on the top of the page. You might need to wait for some time for the instance to reboot.
8. Click on 'Connect to serial port' in the page.
9. In the new window, you might need to wait a bit and press on Enter of your keyboard once; then, you should see the login prompt.
10. Login using the USERNAME and PASSWORD you provided.