User Tools

Site Tools


info:script:root_login_with_bash
Please note, that this is an old archived version of this site. Check out the new version at andunix.net!

root login with bash

On our systems, the root account is set to be a role, so you can't login as root, just su to root from an user which has the root role. Also, the root user has the bourne shell (/bin/sh), but working with /bin/bash is much easier. Using this command, you can directly log in as root with a bash shell.

ssh demo.lab.example.com -t "su - root -c /bin/bash"'

I set it up as an alias in .bashrc:

alias demo_root='ssh demo.lab.example.com -t "su - root -c /bin/bash"'

This enables me logging in with just:

$ demo_root
Password:
# 

The Password prompt on the second line is from the su, for the root password.

info/script/root_login_with_bash.txt · Last modified: 2013-02-04 22:17 (external edit)