2

I am using Raspberry Pi 2 with Jessie raspbian release. I ran into a problem when i was trying to make vncserver start at boot. I followed the instructions present in raspberry pi's website to start vncserver on boot. But after following the instructions specified, my raspberry pi's command line always stays in root mode.

root@raspberry pi:/home/pi#

I guess it was because of the command that's specified in those instructions which had - sudo su command. How do i get pi user back in the command line like this -

pi@raspberrypi~$ 

I tried with these instructions but they didn't help.

Update: I am using my mac to login into Pi and then start vncserver. Now,

  • when i run command whoami in mac -> i get pi as output.
  • when i run command whoami in pi console -> i get root as output. (I start vncserver in mac command line, then open vnc connection to work on pi console).

Any suggestions on what's happening?

Thanks.

3

I am not exactly what you have done, because if you followed the instructions there should be no problem. (I assume you have rebooted.)

vnc is unlikely to work, because those instructions are for SysV. If you are running Jessie this should be started with a systemd service.

See https://raspberrypi.stackexchange.com/a/39374/8697

  • I did reboot my pi several times. I will try using systemd service and see if it resolves my issue. Also does sudo su command create any problem, because when i googled it i found that su command is used to switch user (In my case it got switched to root user). Thanks. – Girish Sortur Dec 27 '15 at 6:48
  • @GirishSortur sudo su (actually su) is the "switch user" command. Without a target it switches to root. Try reading man su. You seem to have (at least) 2 problems here. First fix login (delete all the files you created, or restore any you changed) before worrying about vnc. – Milliways Dec 27 '15 at 7:39
  • I did that already. I removed all the files i created. But only thing i wasn't able to fix was switch the user back to pi from root. I tried most of the methods i googled, but none worked. Thanks – Girish Sortur Dec 27 '15 at 7:54
3

To return to the Pi user just type exit.

  • Tried that, but it switched to normal user temporarily. When i re-started my terminal, it had root user showing up again. Thanks – Girish Sortur Dec 26 '15 at 17:40
  • @GirishSortur what is the output of whoami? – Steve Robillard Dec 26 '15 at 22:14
  • I get root as the output of whoami. – Girish Sortur Dec 27 '15 at 6:46
  • Are you perhaps running a saved session using screen or tmux? – Steve Robillard Dec 30 '15 at 4:47
  • I dont think so. I did shutdown and start my raspberry pi several times. I am not sure how its getting saved. Will debug it more. – Girish Sortur Dec 30 '15 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.