'restricted :Unable to redirect output

I logged in to rbash using chsh command. Though,I have logged out from rbash but still I am unable to execute various commands like cd , output redirection commands etc . When I executed this command cat > jmf . I got this result:-

rbash: jmf: restricted: cannot redirect output.

Could any one please tell me where am I going wrong??



Solution 1:[1]

chsh is not used to "log in" to anything. It's used to change your login shell (done by altering the relevant field in the passwd file. If you changed it to rbash, your login shell is restricted. Change it back to bash and you can your redirections and such to work.

Solution 2:[2]

I got this same error from another route. I use 'bash -vx' to execute a script when I want to see commands as the script is running. I accidentally specified 'bash -rx' and got the error mentioned in the title since the script was doing something restricted. As I recall it was trying to redirect stdout to a file in /tmp.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Noufal Ibrahim
Solution 2 Tom Ekberg