-3

I assign an account name arch.

useradd -m -G users  arch
passwd arch

Now su into arch with command su -arch.

enter image description here

How to su into the account name arch with some kind of escape method?

showkey
  • 482
  • 42
  • 140
  • 295

2 Answers2

0

I think the confusion is because you could login as root using

su - # There are no options in this case and the default login is root

But you're not supposed to do

su -arch #Anything the follows is an option

Since a is not a valid option you got an error

The right way could be anyone among the below

su arch 
su - arch # mind the space
su -- arch # The -- marks the end of options, gives way for non-options arguments
sjsam
  • 21,411
  • 5
  • 55
  • 102
0

Here's few ways you can su with a login shell

su - arch
su -l arch
su --login arch

The problem is options processing with the command below - there is no su -a option

su -arch