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: ...
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. ...
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:
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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
* 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 (...
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 ...
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 ...
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 ...
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
ExecStart=-/sbin/getty/ --noclear -a root %I $TERM
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
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 ...
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.
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.
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 .
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 ...
After a lot of test i edited the FS_MOUNTOPTIONS line:
vfat is the filesystem
umask=0000 is the permission of the file and folder. 0000 means rwx-rwx-rwx
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.
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):
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.
sudo python script.py
Due to the way the SD-card reader is connected in Macbooks, you can't mount the root Filesystem on Partition 2 of the card which is formatted in EXT (no virtual machine or other Programm will be able to access the SD-reader in OSX). The first partition is FAT32, which is automatically mounted by OSX and shows up in Finder.
You can only boot native to Ubuntu ...
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'...
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 ...