Hot answers tagged

38

If you want to login as root using SSH or WinSCP you need to edit the config of SSHD, do this: Login, and edit this file: sudo nano /etc/ssh/sshd_config Find this line: PermitRootLogin without-password Edit: PermitRootLogin yes Close and save file reboot or restart sshd service using: /etc/init.d/ssh restart Set a root password if there isn't one already: ...


21

To clarify a bit: There are no "sudo commands", there are only commands that need root privileges to operate correctly and sudo is the command to obtain them for one command: sudo simply runs the given command as root (read "sudo" as the imperative sentence "superuser, do something!"). The rules about which users may do this are written down in /etc/sudoers. ...


14

Raspbian by default is configured so that the root account can't be logged into using a password. This is done by starting with an entry in /etc/password which begins: root:x:0:0: The fields are separated by colons and explained in man 5 passwd (note the 5, since man passwd will give you the man page for the command passwd; section 5 is for configuration ...


14

Typing gksudo in Terminal and then hitting enter. A window named Run program will pop up. Then typing pcmanfm on the Run text field. Pressing ok. That worked for me.


12

Open the Terminal Type sudo pcmanfm The root file manager opens.


8

This explains how you can boot the Raspberry Pi into a system with the root partition on an LVM volume. LVM is Logical Volume Management. Configuration In order for early-boot to be able to access an LVM volume the kernel must be able to load the LVM module before the root partition is mounted. This requires that an initial ramdisk (initrd) is configured ...


7

This Answer is out of date (Raspbian now uses PARTUUID to identify root partition) and uses /bin/bash rather than the POSIX compliant /bin/sh It may work to repair the partition, but changing cmdline.txt to contain root=/dev/mmcblk0p2 (without a matching change to etc/fstab) may cause subsequent boot problems. One way to get in to a safe mode of sorts ...


7

Found myself in the same situation just now. Took quite some time to figure out (taking into account that I had neither a USB keyboard nor a Linux computer around this was a long quest). The reason for this problem appearing seemingly out of the blue is fsck - the automated file system check, which runs on startup. During this check fsck may discover that ...


6

Yes, you can configure sudo to only allow the user to run certain commands with additional privileges. You can changed this in your /etc/sudoers file, but it's advisable not to do this directly but use sudo visudo command for this. In default system installation you should find such line: pi ALL=(ALL) NOPASSWD: ALL It tells sudo to allow user pi to run ...


6

The simplest way is just ifconfig eth hw ether XX:XX:XX:XX:XX:XX You can also install macchanger: sudo apt-get install macchanger Features: * set specific MAC address of a network interface * set the MAC randomly * set a MAC of another vendor * set another MAC of the same vendor * set a MAC of the same kind (eg: wireless card) * display a vendor MAC list (...


5

To run your program just add it to ~/.bashrc using sudo, as the pi user has sudoers permissions without password authentication already, this way the program will be started when you login. What you can do instead to is create a service unit, is you are using arch on your pi just create a new systemd unit file in /etc/systemd/system and then enable it, the ...


5

Why have a product an software that's so tricky to grasp when it's meant to be educational. To be glib: if it were easy, there wouldn't be much to learn, would there? By analogy, if you want to learn to cook but all you've ever done is stick frozen meals in a microwave, it may be challenging at first. However, it's not intentionally difficult just to ...


5

MariusMatutiaes accepted answer worked for Raspbian Jessie (March 2016) too: Edit the file /lib/systemd/system/getty@.service and change the line ExecStart=-/sbin/agetty --noclear %I $TERM to ExecStart=-/sbin/getty/ --noclear -a root %I $TERM Reference: https://superuser.com/a/970013


5

Check if your boot folder is empty using cd /boot/ in a terminal session. If so, you should be able to mount it to the SD card using a simple command. sudo mount /dev/mmcblk0p1 /boot All this command does is mount the boot partition on your SD card. Which explains the The boot partition is not mounted - cannot configure. error. sudo raspi-config looks ...


5

This is easy. By default the stfp-server of a Raspberry Pi is located at: /usr/lib/sftp-server, so we need to get WinSCP to execute it with sudo. Go to your WinSCP profile (Session > Sites > Site Manager) Click on Edit > Advanced... > Environment > SFTP Insert sudo su -c /usr/lib/sftp-server at "SFTP Server" Save and connect


4

I basically didn't have a Keyboard I could use for my Raspberry Pi and was wanting to do the same. I did this: Insert the SD card into the MacBook Open Applications > Disk Utility > right click on the partition under "Apple SDXC Reader Media" > unmount Take a note of the "Device" name on "Apple SDXC Reader Media" mine was disk3 Install Virtual Box Run this ...


4

I'm not sure why you would want to autologin as root, but if its just for the sake of saving those few seconds you can choose to auto login with the pi username in the raspi-config settings:


4

Raspbian does NOT have a root password. It differs from Ubuntu in that respect. You can create a root password, but AFAIK that requires sudo. The best bet is to edit the files by mounting the SD Card on a Linux machine. This can be done on the Pi if 1. you have a SD Card reader 2. You use a good OS on another SD to boot the Pi.


4

To set a root password: Boot up and login normally. Run:sudo passwd root Type in the new password for root as prompted Source: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=5056&start=25


4

You will find that 'mc' ( midnight commander ) is the fastest for browsing and file operations - CTRL+o will give you a root shell prompt to view output of commands. On a Pi, it's lightweight. You don't want to swap to your microSD. Invoke `apt-get -y install mc' . A number of common operations are 'hit-one-key-and-presto!' on the Function keys .


4

Since you probably updated your raspian in the process, you might have been caught by this change: As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. The solution to this is quite simple: Put the SD card into some other machine and place an empty file called "ssh" into the boot partition ...


3

While I'm not quite certain why Linux decides to say permission is denied rather than giving a more helpful error the problem here is that you're not telling it what you want to do, you're just giving it the path of a file. I'm assuming you want to edit the file to change your hostname? In that case you'll want to open it in an editor like nano for example. ...


3

On raspbian it is possible to create the initramfs with the mkinitramfs command. I have successfully boot on a lvm root partition with the following steps: create the lvm partition copy actual root partition on the lvm partition (I have restart with root partition ro and copy with the dd command) create a lvm partition (bigger than actual root partition): ...


3

The root is the system administrator on *nix systems, so running as root means running with system administration privileges. The normal way is to precede commands which need privileges with sudo. E.g. sudo python script.py or sudo ./script.py etc.


3

As lenik sayed, echo is a built-in and thus cannot be used with sudo like that. But in your case, it's the redirection (>) which cause problem (thanks goldilocks). Indeed, the redirection is also made by the shell and thus have the same restriction than the built-ins. Instead, you should switch to root first: $ sudo su # echo 24 > export Or if you don'...


3

AFAIK there is no /dev/gpio driver in Linux. There is, however, /sys/class/gpio directory, which makes very similar case. But that's only one way to interface with GPIO on RaspberryPi. The other one is to bypass Linux kernel drivers and talk to memory mapped hardware registers directly. Some libraries/applications can only use one of this methods while ...


3

To return to the Pi user just type exit.


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


3

You cannot login as root because Raspbian does not have a root password. See Raspbian root default password Normally ssh does not allow root access because this is considered a security risk. You should be able to do everything you need using sudo (which is the normal Debian practice). If you REALLY want ssh root access it can be enabled.


3

Disable remote login Run sudo nano /etc/ssh/sshd_config and set PermitRootLogin yes to 'no'. Reboot or restart the ssh service with /etc/init.d/ssh restart Disable root completely To completely disable root-access, either lock it via passwd --lock root or remove the password by executing passwd -d root


Only top voted, non community-wiki answers of a minimum length are eligible