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.

giri-sh
  • 777
  • 10
  • 18

2 Answers2

3

To return to the Pi user just type exit.

Steve Robillard
  • 34,687
  • 17
  • 103
  • 109
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

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • 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. – giri-sh Dec 27 '15 at 06: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 07: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 – giri-sh Dec 27 '15 at 07:54