Pi5 secure shell issue

Hey brains trust. im setting up a new pi5 wanting to use as a nas. its all set up except it wont let me ssh in from my macbook. the password and user are correct but when i enter the details i just get sorry, try again.

i have managed to get in when i wore the pi direct to the mac but once i reboot after connecting to my router it wont let me in again.

it has also failed at making the IP static. i do not know where im going wrong.

help please

1 Like

Hi there, @Peter299741, and welcome to the forum, glad to have you here.

Two things off the top of my head:

  1. Making the Pi’s address static can be a bit confusing using BASH or even the GUI. I find the best way is to connect to your router, find the list of connected devices, find your Pi and then set a static address for it in the router. Then flush the dhcp information on the Pi and it should get the static address when using DHCP. I find it to be a cleaner more newb friendly setup.
  2. If you’ve arrived at the authorisation stage and are not being let through there are three possibilities: the username is wrong, the password is wrong, the keyboard settings on a computer are whack. Usually a fresh SD flash and triple checking username and password solves that for me. I misremember or mistype passwords all the time… :confused:
1 Like

Jane thank you so much. i have added the static ip to the router. i have reset my password several times and it doesn’t change the ‘sorry, try again’ error :disappointed_face:

Hey, Peter299741,

My I ask what happens when you try username ‘root’ and your password?

im not asked to put in the username as it auto logs in. ill switch that and try again.

ok when logging in as root i get the root@peteypi:~#

not sure if thats what i want here but it looks logged in

1 Like

Oooh, that almost is.

Technically you shouldn’t be root all the time, as its a security risk, but now that you are in you can make a new user via the below command.

sudo adduser <username> sudo

It will ask you for a password after this.

Then when SSHing into the pi, the usual syntax is username@IPAddress

Then you should be good to go. :slight_smile:

is that not the user i set up in the pi imager from the start?

No, rather than having root privileges for all accounts by default, users with ‘sudo’ privileges can temporarily become root when they use the ‘sudo’ keyword at the start of a command.

The best way I can think to explain it is that rather than you working on the Command Centre all the time, you work on your PC and only remote shell a single command into the Command Centre when you need to.

It’s just more secure to keep the administrative account separate even when you are technically the Administrator.

well wonderful news i have ssh up and running. champagne for all. now to get my shares working!

thank you so much!

1 Like

Glad to hear it, Peter. <3