Saturday, 17 June 2017

Cenros 6/RHEL SSH tunnel in to another user account

Some times you may need to access another users account to perform some task or another and one way to do this is to use the SSH facility. To test it out we first change to root user and add a variable to the /etc/profile file.

$ sudo su

# vi /etc/profile

And in a suitable spare space add the following line 

MINIMALLINUX=atestvariable (change to suit your id)

Then append it to the end of the export line which is already there.

export PATH (and others) MINIMALLINUX

Now create a new user 'guest' and the /etc/profile file will be automatically copied to the new user's /etc/ directory.

# useradd guest

Give it a passwd

# passwd guest

New user & SSH Centos 6
Now having set up the new user we can SSH into the home directory to test out the /etc/profile variable we added earlier.

# ssh -l guest localhost

This should get you logged in.