1.4 KiB
1.4 KiB
RHCSA 1.3: SSH and switching users
Running one command on another machine over SSH, switching users with a full login environment, running a command as another user, and logging in on a text console.
Before you start
The peer, at 10.99.0.2 (name peer), stands in for the second VM. It
runs its own sshd. It shares this VM's files and users, so it has the same
host name, but not its network: logins to it come from 10.99.0.1. The
lab creates user tester (password Lab-Pass-1) to log in there with.
Write the results of tasks 1 and 3 to the files named there, so they can
be checked.
Tasks
- Run
hostnameon the peer over SSH astester, without staying logged in, and save the name it prints to/root/lab-answers/1. - Create a user
alicewith a password, then switch to her with a full login environment from your normal user. - As root, run
idas alice without switching to her and without a password, and save its output to/root/lab-answers/3. - Log in on the second text console of this VM (
tty2) as alice, and stay logged in there while you check.
Hints
ssh USER@HOST COMMAND;sudo teeor| sudo tee /root/lab-answers/1.useradd,passwd;su - alice, thenpwdandwhoami.sudo -u alice id,runuser -u alice -- id.- The VM's console: Ctrl+Alt+F2 (in a VM window, send the key combination
from its menu), or
chvt 2.wholists the logins.